greth: Use return value of register_netdev
authorTobias Klauser <tklauser@distanz.ch>
Tue, 17 Aug 2010 06:11:24 +0000 (06:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Aug 2010 07:04:31 +0000 (00:04 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/greth.c

index f15c64f1cd3886a77ec09354c7caf3408eba14b4..fbeaf70d1727ec5bbde9b1d003ca1973946f19a9 100644 (file)
@@ -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;
        }