Patchwork greth: Use return value of register_netdev

login
register
mail settings
Submitter Tobias Klauser
Date Aug. 17, 2010, 4:11 p.m.
Message ID <1282061484-19377-1-git-send-email-tklauser@distanz.ch>
Download mbox | patch
Permalink /patch/61928/
State Accepted
Delegated to: David Miller
Headers show

Comments

Tobias Klauser - Aug. 17, 2010, 4:11 p.m.
Use the return value provided by register_netdev on error instead of
hard setting it to -ENOMEM.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/net/greth.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
David Miller - Aug. 19, 2010, 7:05 a.m.
From: Tobias Klauser <tklauser@distanz.ch>
Date: Tue, 17 Aug 2010 18:11:24 +0200

> Use the return value provided by register_netdev on error instead of
> hard setting it to -ENOMEM.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

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

Patch

diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index f15c64f..fbeaf70 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -1547,10 +1547,10 @@  static int __devinit greth_of_probe(struct platform_device *ofdev, const struct
 	dev->netdev_ops = &greth_netdev_ops;
 	dev->ethtool_ops = &greth_ethtool_ops;
 
-	if (register_netdev(dev)) {
+	err = register_netdev(dev);
+	if (err) {
 		if (netif_msg_probe(greth))
 			dev_err(greth->dev, "netdevice registration failed.\n");
-		err = -ENOMEM;
 		goto error5;
 	}