summaryrefslogtreecommitdiff
path: root/drivers/net/sunhme.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2010-08-17 10:13:05 +0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 11:04:32 +0400
commit0b29b894b17747f7fa0c5668281c68b8cde7647b (patch)
tree8352b30ae97b6b8e1460fc5865fe554890e500c4 /drivers/net/sunhme.c
parentcb5d991a99104565f7b622b1b97587f4b1effa82 (diff)
downloadlinux-0b29b894b17747f7fa0c5668281c68b8cde7647b.tar.xz
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/net/sunhme.c')
-rw-r--r--drivers/net/sunhme.c6
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
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;