Commit ae1d60c4 authored by Ruan Jinjie's avatar Ruan Jinjie Committed by Jakub Kicinski

net: hisilicon: fix the return value handle and remove redundant netdev_err()...

net: hisilicon: fix the return value handle and remove redundant netdev_err() for platform_get_irq()

There is no possible for platform_get_irq() to return 0
and the return value of platform_get_irq() is more sensible
to show the error reason.

And there is no need to call the netdev_err() function directly to print
a custom message when handling an error from platform_get_irq() function as
it is going to display an appropriate error message in case of a failure.
Signed-off-by: default avatarRuan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20230731073858.3633193-1-ruanjinjie@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 34093c9f
......@@ -960,8 +960,8 @@ static int hip04_mac_probe(struct platform_device *pdev)
}
irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
ret = -EINVAL;
if (irq < 0) {
ret = irq;
goto init_fail;
}
......
......@@ -862,8 +862,8 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
goto out_disconnect_phy;
ndev->irq = platform_get_irq(pdev, 0);
if (ndev->irq <= 0) {
ret = -ENODEV;
if (ndev->irq < 0) {
ret = ndev->irq;
goto out_disconnect_phy;
}
......
......@@ -1206,9 +1206,8 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
}
ndev->irq = platform_get_irq(pdev, 0);
if (ndev->irq <= 0) {
netdev_err(ndev, "No irq resource\n");
ret = -EINVAL;
if (ndev->irq < 0) {
ret = ndev->irq;
goto out_phy_node;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment