2020-04-30 12:17:37

by Tang Bin

[permalink] [raw]
Subject: [PATCH] net/faraday: Fix unnecessary check in ftmac100_probe()

The function ftmac100_probe() is only called with an openfirmware
platform device. Therefore there is no need to check that the passed
in device is NULL.

Signed-off-by: Zhang Shengju <[email protected]>
Signed-off-by: Tang Bin <[email protected]>
---
drivers/net/ethernet/faraday/ftmac100.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index 6c247cbbd..2be173b03 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1059,9 +1059,6 @@ static int ftmac100_probe(struct platform_device *pdev)
struct ftmac100 *priv;
int err;

- if (!pdev)
- return -ENODEV;
-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENXIO;
--
2.20.1.windows.1




2020-04-30 19:25:33

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net/faraday: Fix unnecessary check in ftmac100_probe()

From: Tang Bin <[email protected]>
Date: Thu, 30 Apr 2020 20:15:31 +0800

> The function ftmac100_probe() is only called with an openfirmware
> platform device. Therefore there is no need to check that the passed
> in device is NULL.
>
> Signed-off-by: Zhang Shengju <[email protected]>
> Signed-off-by: Tang Bin <[email protected]>

Applied.