Because ndev->irq is unsigned, the check is useless.
Therefore, we need to correct the check by using error variable.
Fixes: cb93b3e11d40 ("drivers: net: smc911x: Check for error irq")
Signed-off-by: Jiasheng Jiang <[email protected]>
---
drivers/net/ethernet/smsc/smc911x.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index dd6f69ced4ee..3118c8b7a8c3 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -2071,11 +2071,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
SET_NETDEV_DEV(ndev, &pdev->dev);
ndev->dma = (unsigned char)-1;
- ndev->irq = platform_get_irq(pdev, 0);
- if (ndev->irq < 0) {
- ret = ndev->irq;
+
+ ret = platform_get_irq(pdev, 0);
+ if (ret < 0)
goto release_both;
- }
+ ndev->irq = ret;
lp = netdev_priv(ndev);
lp->netdev = ndev;
--
2.25.1