diff mbox series

[RFC,V2,1/6] net: bcmgenet: Fix error handling on IRQ retrieval

Message ID 1572702093-18261-2-git-send-email-wahrenst@gmx.net
State RFC
Delegated to: David Miller
Headers show
Series ARM: Enable GENET support for RPi 4 | expand

Commit Message

Stefan Wahren Nov. 2, 2019, 1:41 p.m. UTC
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.

Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

--
2.7.4

Comments

Florian Fainelli Nov. 2, 2019, 7:43 p.m. UTC | #1
On 11/2/2019 6:41 AM, Stefan Wahren wrote:
> 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.
> 
> Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

Not sure if the Fixes tag is necessary here, this is kind of an
exceptional case anyway since you should be specifying valid interrupt
resources to begin with.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 4f689fb..105b3be 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3464,13 +3464,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(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(pdev, 2);

 	if (dn)
 		macaddr = of_get_mac_address(dn);