Skip to content

Commit 2b65f93

Browse files
lategoodbyedavem330
authored andcommitted
net: bcmgenet: Fix error handling on IRQ retrieval
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 <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5b1f0e6 commit 2b65f93

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3458,13 +3458,16 @@ static int bcmgenet_probe(struct platform_device *pdev)
34583458

34593459
priv = netdev_priv(dev);
34603460
priv->irq0 = platform_get_irq(pdev, 0);
3461+
if (priv->irq0 < 0) {
3462+
err = priv->irq0;
3463+
goto err;
3464+
}
34613465
priv->irq1 = platform_get_irq(pdev, 1);
3462-
priv->wol_irq = platform_get_irq_optional(pdev, 2);
3463-
if (!priv->irq0 || !priv->irq1) {
3464-
dev_err(&pdev->dev, "can't find IRQs\n");
3465-
err = -EINVAL;
3466+
if (priv->irq1 < 0) {
3467+
err = priv->irq1;
34663468
goto err;
34673469
}
3470+
priv->wol_irq = platform_get_irq_optional(pdev, 2);
34683471

34693472
if (dn)
34703473
macaddr = of_get_mac_address(dn);

0 commit comments

Comments
 (0)