]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: bcmgenet: Fix error handling on IRQ retrieval
authorStefan Wahren <wahrenst@gmx.net>
Mon, 11 Nov 2019 19:49:21 +0000 (20:49 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Nov 2019 04:07:59 +0000 (20:07 -0800)
This fixes the error handling for the mandatory IRQs. There is no need
for the error message anymore, this is now handled by platform_get_irq.

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 575f162537aff2840b555ccd3d557e941626dfe1..ee4d8ef66f38bea2aa52a2898ad0c8f8de345768 100644 (file)
@@ -3458,13 +3458,16 @@ static int bcmgenet_probe(struct platform_device *pdev)
 
        priv = netdev_priv(dev);
        priv->irq0 = platform_get_irq(pdev, 0);
+       if (priv->irq0 < 0) {
+               err = priv->irq0;
+               goto err;
+       }
        priv->irq1 = platform_get_irq(pdev, 1);
-       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;
+       if (priv->irq1 < 0) {
+               err = priv->irq1;
                goto err;
        }
+       priv->wol_irq = platform_get_irq_optional(pdev, 2);
 
        if (dn)
                macaddr = of_get_mac_address(dn);