From: Tobias Klauser Date: Tue, 17 Aug 2010 06:13:05 +0000 (+0000) Subject: sunhme: Use return value of register_netdev X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=0b29b894b17747f7fa0c5668281c68b8cde7647b;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: David S. Miller --- 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;