[NET]: unregister_netdevice as void
authorStephen Hemminger <shemminger@osdl.org>
Wed, 7 Feb 2007 08:09:58 +0000 (00:09 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 8 Feb 2007 20:39:06 +0000 (12:39 -0800)
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>
include/linux/netdevice.h
net/core/dev.c
net/ipv4/ip_gre.c
net/ipv4/ipip.c
net/ipv6/ip6_tunnel.c
net/ipv6/sit.c

index 2e37f501278825a758a38bae3b15ee678f62102f..1a528548cd1d89e5b690b2ad92e8ec6fee24532c 100644 (file)
@@ -589,7 +589,7 @@ extern int          dev_open(struct net_device *dev);
 extern int             dev_close(struct net_device *dev);
 extern int             dev_queue_xmit(struct sk_buff *skb);
 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            synchronize_net(void);
 extern int             register_netdevice_notifier(struct notifier_block *nb);
index 455d589683e8a99e17edae82447b85fae7f219e6..1e94a1b9a0f4f1b588b88dde9d8c88a1cf39c10f 100644 (file)
@@ -3247,7 +3247,7 @@ void synchronize_net(void)
  *     unregister_netdev() instead of this.
  */
 
-int unregister_netdevice(struct net_device *dev)
+void unregister_netdevice(struct net_device *dev)
 {
        struct net_device *d, **dp;
 
@@ -3258,7 +3258,9 @@ int unregister_netdevice(struct net_device *dev)
        if (dev->reg_state == NETREG_UNINITIALIZED) {
                printk(KERN_DEBUG "unregister_netdevice: device %s/%p never "
                                  "was registered\n", dev->name, dev);
-               return -ENODEV;
+
+               WARN_ON(1);
+               return;
        }
 
        BUG_ON(dev->reg_state != NETREG_REGISTERED);
@@ -3280,11 +3282,7 @@ int unregister_netdevice(struct net_device *dev)
                        break;
                }
        }
-       if (!d) {
-               printk(KERN_ERR "unregister net_device: '%s' not found\n",
-                      dev->name);
-               return -ENODEV;
-       }
+       BUG_ON(!d);
 
        dev->reg_state = NETREG_UNREGISTERING;
 
@@ -3316,7 +3314,6 @@ int unregister_netdevice(struct net_device *dev)
        synchronize_net();
 
        dev_put(dev);
-       return 0;
 }
 
 /**
index 476cb6084c75047026980d44d7ba43b4da39a0cd..51c83500790f7af8270ee6b36a9e95f3fdaa61f4 100644 (file)
@@ -1008,7 +1008,8 @@ ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
                                goto done;
                        dev = t->dev;
                }
-               err = unregister_netdevice(dev);
+               unregister_netdevice(dev);
+               err = 0;
                break;
 
        default:
index 9d719d664e5b986db7c6308926decbd79dd2ee90..da8bbd20c7edcef2df0c464b57089d691dbe03d0 100644 (file)
@@ -754,7 +754,8 @@ ipip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
                                goto done;
                        dev = t->dev;
                }
-               err = unregister_netdevice(dev);
+               unregister_netdevice(dev);
+               err = 0;
                break;
 
        default:
index 8d918348f5bb62b4b61d8dbb82bc7670c1c98542..2b9e3bb7da653b5c3a4ef313590c7e1971832cfe 100644 (file)
@@ -999,7 +999,8 @@ ip6ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
                                break;
                        dev = t->dev;
                }
-               err = unregister_netdevice(dev);
+               err = 0;
+               unregister_netdevice(dev);
                break;
        default:
                err = -EINVAL;
index 77b7b091143887b1cf5528365453e9ed696a17eb..47cfeadac6dd494267dbfe04825130a852594e13 100644 (file)
@@ -686,7 +686,8 @@ ipip6_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
                                goto done;
                        dev = t->dev;
                }
-               err = unregister_netdevice(dev);
+               unregister_netdevice(dev);
+               err = 0;
                break;
 
        default: