Message ID | 20210512100100.12516-1-tangbin@cmss.chinamobile.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: hns: Fix unnecessary check in hns_mdio_probe() | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Guessing tree name failed - patch did not apply |
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;
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@cmss.chinamobile.com> --- drivers/net/ethernet/hisilicon/hns_mdio.c | 5 ----- 1 file changed, 5 deletions(-)