netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: hns: Remove a redundant check in hns_mdio_probe()
@ 2023-08-04  9:27 thunder.leizhen
  2023-08-05 11:29 ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: thunder.leizhen @ 2023-08-04  9:27 UTC (permalink / raw)
  To: Yisen Zhuang, Salil Mehta, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev
  Cc: Zhen Lei

From: Zhen Lei <thunder.leizhen@huawei.com>

Traverse all devices when a new driver is installed, or, traverse all
drivers when a new device is added. In any case, the input argument
'pdev' of drv->probe() cannot be NULL.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns_mdio.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
index 9232caaf0bdc1bb..37ff12ff0062442 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -498,11 +498,6 @@ static int hns_mdio_probe(struct platform_device *pdev)
 	struct mii_bus *new_bus;
 	int ret;
 
-	if (!pdev) {
-		dev_err(NULL, "pdev is NULL!\r\n");
-		return -ENODEV;
-	}
-
 	mdio_dev = devm_kzalloc(&pdev->dev, sizeof(*mdio_dev), GFP_KERNEL);
 	if (!mdio_dev)
 		return -ENOMEM;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-06 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-04  9:27 [PATCH] net: hns: Remove a redundant check in hns_mdio_probe() thunder.leizhen
2023-08-05 11:29 ` Simon Horman
2023-08-06 10:08   ` Leizhen (ThunderTown)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).