diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2010-08-17 02:13:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-19 03:04:32 -0400 |
commit | 0b29b894b17747f7fa0c5668281c68b8cde7647b (patch) | |
tree | 8352b30ae97b6b8e1460fc5865fe554890e500c4 /drivers | |
parent | cb5d991a99104565f7b622b1b97587f4b1effa82 (diff) |
sunhme: Use return value of register_netdev
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sunhme.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index bd0df1c14955..d96431eb698b 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2808,7 +2808,8 @@ static int __devinit happy_meal_sbus_probe_one(struct platform_device *op, int i | |||
2808 | happy_meal_set_initial_advertisement(hp); | 2808 | happy_meal_set_initial_advertisement(hp); |
2809 | spin_unlock_irq(&hp->happy_lock); | 2809 | spin_unlock_irq(&hp->happy_lock); |
2810 | 2810 | ||
2811 | if (register_netdev(hp->dev)) { | 2811 | err = register_netdev(hp->dev); |
2812 | if (err) { | ||
2812 | printk(KERN_ERR "happymeal: Cannot register net device, " | 2813 | printk(KERN_ERR "happymeal: Cannot register net device, " |
2813 | "aborting.\n"); | 2814 | "aborting.\n"); |
2814 | goto err_out_free_coherent; | 2815 | goto err_out_free_coherent; |
@@ -3130,7 +3131,8 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev, | |||
3130 | happy_meal_set_initial_advertisement(hp); | 3131 | happy_meal_set_initial_advertisement(hp); |
3131 | spin_unlock_irq(&hp->happy_lock); | 3132 | spin_unlock_irq(&hp->happy_lock); |
3132 | 3133 | ||
3133 | if (register_netdev(hp->dev)) { | 3134 | err = register_netdev(hp->dev); |
3135 | if (err) { | ||
3134 | printk(KERN_ERR "happymeal(PCI): Cannot register net device, " | 3136 | printk(KERN_ERR "happymeal(PCI): Cannot register net device, " |
3135 | "aborting.\n"); | 3137 | "aborting.\n"); |
3136 | goto err_out_iounmap; | 3138 | goto err_out_iounmap; |