summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hisi_femac.c
diff options
context:
space:
mode:
authorRuan Jinjie <ruanjinjie@huawei.com>2023-07-31 15:38:58 +0800
committerJakub Kicinski <kuba@kernel.org>2023-08-02 12:06:23 -0700
commitae1d60c41e581be049aa84dd53aca89027101ce1 (patch)
treed4005b359c0b6b1116ff8cf8aed332b229a89223 /drivers/net/ethernet/hisilicon/hisi_femac.c
parent34093c9fa05df24558d1e2c5d32f7f93b2c97ee9 (diff)
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: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20230731073858.3633193-1-ruanjinjie@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hisi_femac.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hisi_femac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hisi_femac.c b/drivers/net/ethernet/hisilicon/hisi_femac.c
index ce2571c16e43..cb7b0293fe85 100644
--- a/drivers/net/ethernet/hisilicon/hisi_femac.c
+++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
@@ -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;
}