Thread (12 messages) flat view 12 messages, 5 authors, 9d ago
COOLING9d

[PATCH 4/4] net: bcmgenet: Propagate WoL IRQ errors

From: <hidden>
Date: 2026-08-20 11:15:35
Also in: lkml
Subsystem: broadcom genet ethernet driver, networking drivers, the rest · Maintainers: Doug Berger, Florian Fainelli, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: bui duc phuc <redacted>

Propagate errors from platform_get_irq_optional() instead of only
handling -EPROBE_DEFER. Allow -ENXIO to indicate that the optional
WoL IRQ is not available.

Also propagate errors from devm_request_irq() instead of continuing
the probe when the WoL IRQ cannot be requested.

Found by manual code inspection.

Signed-off-by: bui duc phuc <redacted>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index a2305e6428d1..c1c66a52efd0 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3993,7 +3993,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
 		goto err;
 	}
 	priv->wol_irq = platform_get_irq_optional(pdev, 2);
-	if (priv->wol_irq == -EPROBE_DEFER) {
+	if (priv->wol_irq < 0 && priv->wol_irq != -ENXIO) {
 		err = priv->wol_irq;
 		goto err;
 	}
@@ -4033,8 +4033,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
 	if (priv->wol_irq > 0) {
 		err = devm_request_irq(&pdev->dev, priv->wol_irq,
 				       bcmgenet_wol_isr, 0, dev->name, priv);
-		if (!err)
-			device_set_wakeup_capable(&pdev->dev, 1);
+		if (err)
+			goto err;
+
+		device_set_wakeup_capable(&pdev->dev, 1);
 	}
 
 	/* Set the needed headroom to account for any possible
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help