atm: fore200e: Drop unnecessary of_match_device()
Subsystems (3)
PATCH 1/1 atm: fore200e: Drop unnecessary of_match_device()
It is not necessary to call of_match_device() in probe. If we made it to probe, then we've already successfully matched.
--- drivers/atm/fore200e.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/atm/fore200e.c +1 -7
@@ -36,7 +36,7 @@#ifdef CONFIG_SBUS #include <linux/of.h> -#include <linux/of_device.h> +#include <linux/platform_device.h> #include <asm/idprom.h> #include <asm/openprom.h> #include <asm/oplib.h>
@@ -2520,18 +2520,12 @@ static int fore200e_init(struct fore200e *fore200e, struct device *parent) }#ifdef CONFIG_SBUS -static const struct of_device_id fore200e_sba_match[];static int fore200e_sba_probe (struct platform_device *op) { -const struct of_device_id *match;struct fore200e *fore200e;static int index =0 ;int err; - match =of_match_device (fore200e_sba_match, &op->dev); -if (!match) -return -EINVAL ; - fore200e =kzalloc (sizeof (struct fore200e ),GFP_KERNEL );if (!fore200e)return -ENOMEM ;
Signature · 1 line
2.40.1
Quoted 4 lines · Rob Herring
It is not necessary to call
of_match_device()in probe. If we made it to probe, then we've already successfully matched.Signed-off-by Rob Herring <[email protected]>
I agree that the check is redundant.
And that with it removed, the forward declaration of fore200e_sba_match is no longer needed.
Minor nit: I assume the target tree is net-next.
Ideally that would be specified.
Subject: [PATCH net-net] ...
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 7 lines · On Fri, 6 Oct 2023 16:44:21 -0500 you wrote:
It is not necessary to call
of_match_device()in probe. If we made it to probe, then we've already successfully matched.Signed-off-by Rob Herring <[email protected]>--- drivers/atm/fore200e.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
Here is the summary with links:
- atm: fore200e: Drop unnecessary of_match_device()
https://git.kernel.org/netdev/net-next/c/f0107b864f00
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html