diff mbox series

atm: fore200e: Drop unnecessary of_match_device()

Message ID 20231006214421.339445-1-robh@kernel.org (mailing list archive)
State Accepted
Commit f0107b864f004bc6fa19bf6d5074b4a366f3e16a
Delegated to: Netdev Maintainers
Headers show
Series atm: fore200e: Drop unnecessary of_match_device() | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1364 this patch: 1364
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/build_clang success Errors and warnings before: 1387 this patch: 1387
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1389 this patch: 1389
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 26 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Rob Herring (Arm) Oct. 6, 2023, 9:44 p.m. UTC
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 <robh@kernel.org>
---
 drivers/atm/fore200e.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Simon Horman Oct. 9, 2023, 1:13 p.m. UTC | #1
On Fri, Oct 06, 2023 at 04:44:21PM -0500, Rob Herring 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 <robh@kernel.org>

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] ...

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Oct. 10, 2023, 10:50 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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 <robh@kernel.org>
> ---
>  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!
diff mbox series

Patch

diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index fb2be3574c26..50d8ce20ae5b 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -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;