sunhme: Use return value of register_netdev
authorTobias Klauser <tklauser@distanz.ch>
Tue, 17 Aug 2010 06:13:05 +0000 (06:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Aug 2010 07:04:32 +0000 (00:04 -0700)
Use the return value provided by register_netdev on error instead of
using a previously set value.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sunhme.c

index bd0df1c1495587e9f6cf5f03ed85f98fbce5c2c7..d96431eb698bb3417c6161facc10898c67953b58 100644 (file)
@@ -2808,7 +2808,8 @@ static int __devinit happy_meal_sbus_probe_one(struct platform_device *op, int i
        happy_meal_set_initial_advertisement(hp);
        spin_unlock_irq(&hp->happy_lock);
 
-       if (register_netdev(hp->dev)) {
+       err = register_netdev(hp->dev);
+       if (err) {
                printk(KERN_ERR "happymeal: Cannot register net device, "
                       "aborting.\n");
                goto err_out_free_coherent;
@@ -3130,7 +3131,8 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
        happy_meal_set_initial_advertisement(hp);
        spin_unlock_irq(&hp->happy_lock);
 
-       if (register_netdev(hp->dev)) {
+       err = register_netdev(hp->dev);
+       if (err) {
                printk(KERN_ERR "happymeal(PCI): Cannot register net device, "
                       "aborting.\n");
                goto err_out_iounmap;