aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2007-02-07 03:09:58 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 15:39:06 -0500
commit22f8cde5bc336fd19603bb8c4572b33d14f14f87 (patch)
tree7a566269b9d294a1a90e8368a005e1b3fbc5e984 /net
parentf48d5ff1e44562a0ee87ce8ea3b798ce9d84370d (diff)
[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: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c13
-rw-r--r--net/ipv4/ip_gre.c3
-rw-r--r--net/ipv4/ipip.c3
-rw-r--r--net/ipv6/ip6_tunnel.c3
-rw-r--r--net/ipv6/sit.c3
5 files changed, 13 insertions, 12 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 455d589683e8..1e94a1b9a0f4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3247,7 +3247,7 @@ void synchronize_net(void)
3247 * unregister_netdev() instead of this. 3247 * unregister_netdev() instead of this.
3248 */ 3248 */
3249 3249
3250int unregister_netdevice(struct net_device *dev) 3250void unregister_netdevice(struct net_device *dev)
3251{ 3251{
3252 struct net_device *d, **dp; 3252 struct net_device *d, **dp;
3253 3253
@@ -3258,7 +3258,9 @@ int unregister_netdevice(struct net_device *dev)
3258 if (dev->reg_state == NETREG_UNINITIALIZED) { 3258 if (dev->reg_state == NETREG_UNINITIALIZED) {
3259 printk(KERN_DEBUG "unregister_netdevice: device %s/%p never " 3259 printk(KERN_DEBUG "unregister_netdevice: device %s/%p never "
3260 "was registered\n", dev->name, dev); 3260 "was registered\n", dev->name, dev);
3261 return -ENODEV; 3261
3262 WARN_ON(1);
3263 return;
3262 } 3264 }
3263 3265
3264 BUG_ON(dev->reg_state != NETREG_REGISTERED); 3266 BUG_ON(dev->reg_state != NETREG_REGISTERED);
@@ -3280,11 +3282,7 @@ int unregister_netdevice(struct net_device *dev)
3280 break; 3282 break;
3281 } 3283 }
3282 } 3284 }
3283 if (!d) { 3285 BUG_ON(!d);
3284 printk(KERN_ERR "unregister net_device: '%s' not found\n",
3285 dev->name);
3286 return -ENODEV;
3287 }
3288 3286
3289 dev->reg_state = NETREG_UNREGISTERING; 3287 dev->reg_state = NETREG_UNREGISTERING;
3290 3288
@@ -3316,7 +3314,6 @@ int unregister_netdevice(struct net_device *dev)
3316 synchronize_net(); 3314 synchronize_net();
3317 3315
3318 dev_put(dev); 3316 dev_put(dev);
3319 return 0;
3320} 3317}
3321 3318
3322/** 3319/**
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 476cb6084c75..51c83500790f 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1008,7 +1008,8 @@ ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
1008 goto done; 1008 goto done;
1009 dev = t->dev; 1009 dev = t->dev;
1010 } 1010 }
1011 err = unregister_netdevice(dev); 1011 unregister_netdevice(dev);
1012 err = 0;
1012 break; 1013 break;
1013 1014
1014 default: 1015 default:
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 9d719d664e5b..da8bbd20c7ed 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -754,7 +754,8 @@ ipip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
754 goto done; 754 goto done;
755 dev = t->dev; 755 dev = t->dev;
756 } 756 }
757 err = unregister_netdevice(dev); 757 unregister_netdevice(dev);
758 err = 0;
758 break; 759 break;
759 760
760 default: 761 default:
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 8d918348f5bb..2b9e3bb7da65 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -999,7 +999,8 @@ ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
999 break; 999 break;
1000 dev = t->dev; 1000 dev = t->dev;
1001 } 1001 }
1002 err = unregister_netdevice(dev); 1002 err = 0;
1003 unregister_netdevice(dev);
1003 break; 1004 break;
1004 default: 1005 default:
1005 err = -EINVAL; 1006 err = -EINVAL;
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 77b7b0911438..47cfeadac6dd 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -686,7 +686,8 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
686 goto done; 686 goto done;
687 dev = t->dev; 687 dev = t->dev;
688 } 688 }
689 err = unregister_netdevice(dev); 689 unregister_netdevice(dev);
690 err = 0;
690 break; 691 break;
691 692
692 default: 693 default: