All of lore.kernel.org
 help / color / mirror / Atom feed
From: phucduc.bui@gmail.com
To: Justin Chen <justin.chen@broadcom.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Doug Berger <opendmb@gmail.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 3/4] net: systemport: Propagate IRQ lookup errors
Date: Thu, 20 Aug 2026 18:14:55 +0700	[thread overview]
Message-ID: <20260820111456.97947-4-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260820111456.97947-1-phucduc.bui@gmail.com>

From: bui duc phuc <phucduc.bui@gmail.com>

Propagate the error codes returned by platform_get_irq() and
platform_get_irq_optional() instead of converting them to -EINVAL.

For the optional WoL IRQ, allow -ENXIO to indicate that the IRQ is not
available, but propagate any other error returned by the IRQ lookup.

Found by manual code inspection.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 4d06c6ba6641..2acaffccdb08 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2499,14 +2499,22 @@ static int bcm_sysport_probe(struct platform_device *pdev)
 	priv->num_rx_desc_words = params->num_rx_desc_words;
 
 	priv->irq0 = platform_get_irq(pdev, 0);
+	if (priv->irq0 < 0) {
+		ret = priv->irq0;
+		goto err_free_netdev;
+	}
 	if (!priv->is_lite) {
 		priv->irq1 = platform_get_irq(pdev, 1);
 		priv->wol_irq = platform_get_irq_optional(pdev, 2);
 	} else {
 		priv->wol_irq = platform_get_irq_optional(pdev, 1);
 	}
-	if (priv->irq0 <= 0 || (priv->irq1 <= 0 && !priv->is_lite)) {
-		ret = -EINVAL;
+	if (priv->irq1 < 0 && !priv->is_lite) {
+		ret = priv->irq1;
+		goto err_free_netdev;
+	}
+	if (priv->wol_irq < 0 && priv->wol_irq != -ENXIO) {
+		ret = priv->wol_irq;
 		goto err_free_netdev;
 	}
 
-- 
2.43.0


  parent reply	other threads:[~2026-08-20 11:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 11:14 [PATCH 0/4] net: broadcom: Improve IRQ error handling phucduc.bui
2026-08-20 11:14 ` [PATCH 1/4] net: bcmasp: Use platform_get_irq() for IRQ lookup phucduc.bui
2026-08-20 11:14 ` [PATCH 2/4] net: bcmasp: Propagate WoL IRQ errors from probe phucduc.bui
2026-08-20 11:14 ` phucduc.bui [this message]
2026-08-20 11:14 ` [PATCH 4/4] net: bcmgenet: Propagate WoL IRQ errors phucduc.bui
2026-08-20 13:30 ` [PATCH 0/4] net: broadcom: Improve IRQ error handling Paolo Abeni

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=20260820111456.97947-4-phucduc.bui@gmail.com \
    --to=phucduc.bui@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=justin.chen@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.