Re: [PATCH v3 3/3] net: xilinx: axienet: Propagate errors from platform_get_irq()
From: Pandey, Radhey Shyam
Date: Tue Aug 18 2026 - 02:43:14 EST
On 8/17/2026 4:22 PM, phucduc.bui@xxxxxxxxx wrote:
From: bui duc phuc <phucduc.bui@xxxxxxxxx>This is a bug fix. So please add a fixes tag and same for 1/3 patch.
platform_get_irq() returns a non-zero IRQ number on success and a
negative error number on failure. Therefore, 0 should not be treated
as an invalid IRQ number.
Propagate the original error code instead of overwriting it with
-ENOMEM.
Remove the redundant error message since platform_get_irq() already
reports errors when the IRQ lookup fails.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xxxxxxx>
Thanks!
---
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 50f88a38b6f6..d982ab6f8a4a 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -2968,10 +2968,10 @@ static int axienet_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "could not map DMA regs\n");
return PTR_ERR(lp->dma_regs);
}
- if (lp->rx_irq <= 0 || lp->tx_irq <= 0) {
- dev_err(&pdev->dev, "could not determine irqs\n");
- return -ENOMEM;
- }
+ if (lp->rx_irq < 0)
+ return lp->rx_irq;
+ if (lp->tx_irq < 0)
+ return lp->tx_irq;
if (lp->eth_irq < 0 && lp->eth_irq != -ENXIO)
return lp->eth_irq;