[PATCH v3 3/3] net: xilinx: axienet: Propagate errors from platform_get_irq()
Pandey, Radhey Shyam
radheys at amd.com
Mon Aug 17 23:41:18 PDT 2026
On 8/17/2026 4:22 PM, phucduc.bui at gmail.com wrote:
> From: bui duc phuc <phucduc.bui at gmail.com>
>
> 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 at gmail.com>
This is a bug fix. So please add a fixes tag and same for 1/3 patch.
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey at amd.com>
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;
>
More information about the linux-arm-kernel
mailing list