[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1572702093-18261-2-git-send-email-wahrenst@gmx.net>
Date: Sat, 2 Nov 2019 14:41:28 +0100
From: Stefan Wahren <wahrenst@....net>
To: Matthias Brugger <matthias.bgg@...nel.org>,
Matthias Brugger <mbrugger@...e.com>,
"David S . Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>
Cc: Eric Anholt <eric@...olt.net>,
Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
Doug Berger <opendmb@...il.com>, netdev@...r.kernel.org,
bcm-kernel-feedback-list@...adcom.com,
linux-arm-kernel@...ts.infradead.org,
Stefan Wahren <wahrenst@....net>
Subject: [PATCH RFC V2 1/6] 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.
Fixes: 1c1008c793fa ("net: bcmgenet: add main driver file")
Signed-off-by: Stefan Wahren <wahrenst@....net>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
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);
--
2.7.4
Powered by blists - more mailing lists