Re: [PATCH net v4 3/3] net: xilinx: axienet: Fix IRQ error handling

From
Gupta, Suraj <suraj.gupta2@amd.com>
Date
2026-08-22 14:54:10
Also in
lkml, netdev
Reply to
unknown sender, 2026-08-21

On 8/21/2026 6:02 PM, phucduc.bui@gmail.com wrote:
quoted hunk ↗ jump to hunk
From: bui duc phuc <redacted>

irq_of_parse_and_map() returns 0 when parsing or mapping an IRQ fails,
while platform_get_irq() returns a negative error code on failure.
Handle both cases and preserve the original IRQ lookup errors instead
of returning -ENOMEM.

Fixes: 28ef9ebdb64c ("net: axienet: make use of axistream-connected attribute optional")
Signed-off-by: bui duc phuc <redacted>
---

Changes in v4 :
  - Add error handling for irq_of_parse_and_map()

  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 3927ababf833..68b580191508 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -2971,10 +2971,14 @@ 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) {
+		if (!lp->rx_irq || !lp->tx_irq) {
  			dev_err(&pdev->dev, "could not determine irqs\n");
  			return -ENOMEM;
  		}
ENOMEM is a slightly misleading errno for "IRQ not found" on the OF path -EINVAL/-ENXIO would be more accurate. Since we are here, better to correct that also.

Regards,
Suraj

quoted hunk ↗ jump to hunk
+		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;
  
  
Thread (7 messages) 7 messages, 2 authors, last reply 2026-08-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help