diff mbox

net/macb: fix error return code in macb_probe()

Message ID 1366013073-22934-1-git-send-email-nicolas.ferre@atmel.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Nicolas Ferre April 15, 2013, 8:04 a.m. UTC
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Original-idea-by: <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
Hi,

This fix was written originally for at91_ether.c and I found it interesting
to adapt it to macb.
Thanks to Wei Yongjun for finding it.

Best regards,

 drivers/net/ethernet/cadence/macb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller April 15, 2013, 6:10 p.m. UTC | #1
From: Nicolas Ferre <nicolas.ferre@atmel.com>
Date: Mon, 15 Apr 2013 10:04:33 +0200

> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
> 
> Original-idea-by: <yongjun_wei@trendmicro.com.cn>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 7fd0e3e..6be513d 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1602,9 +1602,9 @@  static int __init macb_probe(struct platform_device *pdev)
 		goto err_out_free_irq;
 	}
 
-	if (macb_mii_init(bp) != 0) {
+	err = macb_mii_init(bp);
+	if (err)
 		goto err_out_unregister_netdev;
-	}
 
 	platform_set_drvdata(pdev, dev);