mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
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>
This commit is contained in:
parent
cb5d991a99
commit
0b29b894b1
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue