Commit 22f8cde5 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NET]: unregister_netdevice as void

There was no real useful information from the unregister_netdevice() return
code, the only error occurred in a situation that was a driver bug. So
change it to a void function.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f48d5ff1
...@@ -589,7 +589,7 @@ extern int dev_open(struct net_device *dev); ...@@ -589,7 +589,7 @@ extern int dev_open(struct net_device *dev);
extern int dev_close(struct net_device *dev); extern int dev_close(struct net_device *dev);
extern int dev_queue_xmit(struct sk_buff *skb); extern int dev_queue_xmit(struct sk_buff *skb);
extern int register_netdevice(struct net_device *dev); extern int register_netdevice(struct net_device *dev);
extern int unregister_netdevice(struct net_device *dev); extern void unregister_netdevice(struct net_device *dev);
extern void free_netdev(struct net_device *dev); extern void free_netdev(struct net_device *dev);
extern void synchronize_net(void); extern void synchronize_net(void);
extern int register_netdevice_notifier(struct notifier_block *nb); extern int register_netdevice_notifier(struct notifier_block *nb);
......
...@@ -3247,7 +3247,7 @@ void synchronize_net(void) ...@@ -3247,7 +3247,7 @@ void synchronize_net(void)
* unregister_netdev() instead of this. * unregister_netdev() instead of this.
*/ */
int unregister_netdevice(struct net_device *dev) void unregister_netdevice(struct net_device *dev)
{ {
struct net_device *d, **dp; struct net_device *d, **dp;
...@@ -3258,7 +3258,9 @@ int unregister_netdevice(struct net_device *dev) ...@@ -3258,7 +3258,9 @@ int unregister_netdevice(struct net_device *dev)
if (dev->reg_state == NETREG_UNINITIALIZED) { if (dev->reg_state == NETREG_UNINITIALIZED) {
printk(KERN_DEBUG "unregister_netdevice: device %s/%p never " printk(KERN_DEBUG "unregister_netdevice: device %s/%p never "
"was registered\n", dev->name, dev); "was registered\n", dev->name, dev);
return -ENODEV;
WARN_ON(1);
return;
} }
BUG_ON(dev->reg_state != NETREG_REGISTERED); BUG_ON(dev->reg_state != NETREG_REGISTERED);
...@@ -3280,11 +3282,7 @@ int unregister_netdevice(struct net_device *dev) ...@@ -3280,11 +3282,7 @@ int unregister_netdevice(struct net_device *dev)
break; break;
} }
} }
if (!d) { BUG_ON(!d);
printk(KERN_ERR "unregister net_device: '%s' not found\n",
dev->name);
return -ENODEV;
}
dev->reg_state = NETREG_UNREGISTERING; dev->reg_state = NETREG_UNREGISTERING;
...@@ -3316,7 +3314,6 @@ int unregister_netdevice(struct net_device *dev) ...@@ -3316,7 +3314,6 @@ int unregister_netdevice(struct net_device *dev)
synchronize_net(); synchronize_net();
dev_put(dev); dev_put(dev);
return 0;
} }
/** /**
......
...@@ -1008,7 +1008,8 @@ ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1008,7 +1008,8 @@ ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
goto done; goto done;
dev = t->dev; dev = t->dev;
} }
err = unregister_netdevice(dev); unregister_netdevice(dev);
err = 0;
break; break;
default: default:
......
...@@ -754,7 +754,8 @@ ipip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -754,7 +754,8 @@ ipip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
goto done; goto done;
dev = t->dev; dev = t->dev;
} }
err = unregister_netdevice(dev); unregister_netdevice(dev);
err = 0;
break; break;
default: default:
......
...@@ -999,7 +999,8 @@ ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -999,7 +999,8 @@ ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
break; break;
dev = t->dev; dev = t->dev;
} }
err = unregister_netdevice(dev); err = 0;
unregister_netdevice(dev);
break; break;
default: default:
err = -EINVAL; err = -EINVAL;
......
...@@ -686,7 +686,8 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -686,7 +686,8 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
goto done; goto done;
dev = t->dev; dev = t->dev;
} }
err = unregister_netdevice(dev); unregister_netdevice(dev);
err = 0;
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment