[PATCH] net: hns: Fix unnecessary check in hns_mdio_probe()

From: Tang Bin
Date: Wed May 12 2021 - 06:00:37 EST


The function hns_mdio_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: Tang Bin <tangbin@xxxxxxxxxxxxxxxxxxxx>
---
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 7df5d7d21..9e1d460c6 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -423,11 +423,6 @@ static int hns_mdio_probe(struct platform_device *pdev)
struct mii_bus *new_bus;
int ret = -ENODEV;

- 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.20.1.windows.1