From: bui duc phuc 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 --- 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