]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: bcmgenet: Avoid touching non-existent interrupt
authorStefan Wahren <wahrenst@gmx.net>
Mon, 11 Nov 2019 19:49:20 +0000 (20:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Nov 2019 04:07:59 +0000 (20:07 -0800)
As platform_get_irq() now prints an error when the interrupt does not
exist, we are getting a confusing error message in case the optional
WOL IRQ is not defined:

  bcmgenet fd58000.ethernet: IRQ index 2 not found

Fix this by using the platform_get_irq_optional().

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmgenet.c

index 3504f77b1a2ff374e7c816a64323f77fc46be9c1..575f162537aff2840b555ccd3d557e941626dfe1 100644 (file)
@@ -3459,7 +3459,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
        priv = netdev_priv(dev);
        priv->irq0 = platform_get_irq(pdev, 0);
        priv->irq1 = platform_get_irq(pdev, 1);
-       priv->wol_irq = platform_get_irq(pdev, 2);
+       priv->wol_irq = platform_get_irq_optional(pdev, 2);
        if (!priv->irq0 || !priv->irq1) {
                dev_err(&pdev->dev, "can't find IRQs\n");
                err = -EINVAL;