Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: phucduc.bui@gmail.com
Cc: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Michal Simek <michal.simek@amd.com>,
	linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] net: xilinx: axienet: Propagate errors from optional IRQ lookup
Date: Fri, 14 Aug 2026 18:00:01 +0100	[thread overview]
Message-ID: <20260814170001.GQ265046@horms.kernel.org> (raw)
In-Reply-To: <20260813042012.17631-1-phucduc.bui@gmail.com>

On Thu, Aug 13, 2026 at 11:20:11AM +0700, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
> 
> platform_get_irq_optional() returns a positive IRQ number on success or
> a negative error code on failure. For an optional IRQ, -ENXIO indicates
> that no optional IRQ is available, while other errors should be propagated.
> 
> Propagate all error codes returned by platform_get_irq_optional() other
> than -ENXIO.
> 
> Another call to platform_get_irq_optional() in the same function already
> handles the return value this way. Apply the same error handling to this
> call site for consistency.

It would be useful to explain how this problem was discovered,
and what testing the patch has seen. Please add an Assisted-by
tag if appropriate.

Link: https://docs.kernel.org/process/coding-assistants.html

> 
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index fcf517069d16..d23e9796725d 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -2957,12 +2957,16 @@ static int axienet_probe(struct platform_device *pdev)
>  			lp->tx_irq = irq_of_parse_and_map(np, 0);
>  			of_node_put(np);
>  			lp->eth_irq = platform_get_irq_optional(pdev, 0);
> +			if (lp->eth_irq < 0 && lp->eth_irq != -ENXIO)
> +				return lp->eth_irq;
>  		} else {
>  			/* Check for these resources directly on the Ethernet node. */
>  			lp->dma_regs = devm_platform_get_and_ioremap_resource(pdev, 1, NULL);
>  			lp->rx_irq = platform_get_irq(pdev, 1);
>  			lp->tx_irq = platform_get_irq(pdev, 0);
>  			lp->eth_irq = platform_get_irq_optional(pdev, 2);
> +			if (lp->eth_irq < 0 && lp->eth_irq != -ENXIO)
> +				return lp->eth_irq;
>  		}

The same check seems to have been added to both arms of the if/else
condition. So it seems to me that it could be moved out of that condition.

I would suggest placing it below the existing rx_irq/tx_irq condition
which appears a few lines below this hunk so that those and
dma_regs errors are still propagated.

>  		if (IS_ERR(lp->dma_regs)) {
>  			dev_err(&pdev->dev, "could not map DMA regs\n");
> -- 
> 2.43.0
> 

  parent reply	other threads:[~2026-08-14 17:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13  4:20 [PATCH v2 1/2] net: xilinx: axienet: Propagate errors from optional IRQ lookup phucduc.bui
2026-08-13  4:20 ` [PATCH v2 2/2] net: xilinx: axienet: Handle optional IRQ return value correctly phucduc.bui
2026-08-14 17:00 ` Simon Horman [this message]
2026-08-15  3:13   ` [PATCH v2 1/2] net: xilinx: axienet: Propagate errors from optional IRQ lookup Bui Duc Phuc
2026-08-17  8:21     ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260814170001.GQ265046@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phucduc.bui@gmail.com \
    --cc=radhey.shyam.pandey@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox