Commit c1e9e5e0 authored by Ruan Jinjie's avatar Ruan Jinjie Committed by Paolo Abeni

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: default avatarRuan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Link: https://lore.kernel.org/r/20230802090657.969923-1-ruanjinjie@huawei.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent c956910d
...@@ -1632,7 +1632,7 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata) ...@@ -1632,7 +1632,7 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata)
for (i = 0; i < max_irqs; i++) { for (i = 0; i < max_irqs; i++) {
ret = platform_get_irq(pdev, i); ret = platform_get_irq(pdev, i);
if (ret <= 0) { if (ret < 0) {
if (pdata->phy_mode == PHY_INTERFACE_MODE_XGMII) { if (pdata->phy_mode == PHY_INTERFACE_MODE_XGMII) {
max_irqs = i; max_irqs = i;
pdata->rxq_cnt = max_irqs / 2; pdata->rxq_cnt = max_irqs / 2;
...@@ -1640,7 +1640,7 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata) ...@@ -1640,7 +1640,7 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata)
pdata->cq_cnt = max_irqs / 2; pdata->cq_cnt = max_irqs / 2;
break; break;
} }
return ret ? : -ENXIO; return ret;
} }
pdata->irqs[i] = ret; pdata->irqs[i] = ret;
} }
......
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