[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230804092753.1207-1-thunder.leizhen@huaweicloud.com>
Date: Fri, 4 Aug 2023 17:27:53 +0800
From: thunder.leizhen@...weicloud.com
To: Yisen Zhuang <yisen.zhuang@...wei.com>,
Salil Mehta <salil.mehta@...wei.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org
Cc: Zhen Lei <thunder.leizhen@...wei.com>
Subject: [PATCH] net: hns: Remove a redundant check in hns_mdio_probe()
From: Zhen Lei <thunder.leizhen@...wei.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@...wei.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
Powered by blists - more mailing lists