Skip to content

Commit c1e9e5e

Browse files
Ruan JinjiePaolo Abeni
authored andcommitted
drivers: net: xgene: Do not check for 0 return after calling platform_get_irq()
It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Link: https://lore.kernel.org/r/20230802090657.969923-1-ruanjinjie@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent c956910 commit c1e9e5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/apm/xgene/xgene_enet_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,15 +1632,15 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata)
16321632

16331633
for (i = 0; i < max_irqs; i++) {
16341634
ret = platform_get_irq(pdev, i);
1635-
if (ret <= 0) {
1635+
if (ret < 0) {
16361636
if (pdata->phy_mode == PHY_INTERFACE_MODE_XGMII) {
16371637
max_irqs = i;
16381638
pdata->rxq_cnt = max_irqs / 2;
16391639
pdata->txq_cnt = max_irqs / 2;
16401640
pdata->cq_cnt = max_irqs / 2;
16411641
break;
16421642
}
1643-
return ret ? : -ENXIO;
1643+
return ret;
16441644
}
16451645
pdata->irqs[i] = ret;
16461646
}

0 commit comments

Comments
 (0)