[PATCH v3 2/3] net: xilinx: axienet: Handle optional IRQ return value correctly
Pandey, Radhey Shyam
radheys at amd.com
Mon Aug 17 23:39:36 PDT 2026
On 8/17/2026 4:22 PM, phucduc.bui at gmail.com wrote:
> From: bui duc phuc <phucduc.bui at gmail.com>
>
> lp->eth_irq is assigned from platform_get_irq_optional(), which returns
> a non-zero interrupt number on success or a negative error number on
> failure. Errors other than -ENXIO are handled before this check,
> so -ENXIO is the only error value that can reach this point.
>
> Check for a negative value instead of treating 0 as an undefined IRQ.
>
> Signed-off-by: bui duc phuc <phucduc.bui at gmail.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey at amd.com>
Thanks!
> ---
> drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index f92951422b2e..50f88a38b6f6 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -3049,7 +3049,7 @@ static int axienet_probe(struct platform_device *pdev)
> ndev->ethtool_ops = &axienet_ethtool_ops;
> }
> /* Check for Ethernet core IRQ (optional) */
> - if (lp->eth_irq <= 0)
> + if (lp->eth_irq < 0)
> dev_info(&pdev->dev, "Ethernet core IRQ not defined\n");
>
> /* Retrieve the MAC address */
More information about the linux-arm-kernel
mailing list