Skip to content

Commit

Permalink
drivers: net: xgene: Do not check for 0 return after calling platform…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
Ruan Jinjie authored and Paolo Abeni committed Aug 3, 2023
1 parent c956910 commit c1e9e5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/apm/xgene/xgene_enet_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,15 +1632,15 @@ static int xgene_enet_get_irqs(struct xgene_enet_pdata *pdata)

for (i = 0; i < max_irqs; i++) {
ret = platform_get_irq(pdev, i);
if (ret <= 0) {
if (ret < 0) {
if (pdata->phy_mode == PHY_INTERFACE_MODE_XGMII) {
max_irqs = i;
pdata->rxq_cnt = max_irqs / 2;
pdata->txq_cnt = max_irqs / 2;
pdata->cq_cnt = max_irqs / 2;
break;
}
return ret ? : -ENXIO;
return ret;
}
pdata->irqs[i] = ret;
}
Expand Down

0 comments on commit c1e9e5e

Please sign in to comment.