diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2003-09-03 10:41:35 -0700 |
|---|---|---|
| committer | Stephen Hemminger <shemminger@osdl.org> | 2003-09-03 10:41:35 -0700 |
| commit | 4e39f29be0eae39e05bdb2d881849ff0560a7b64 (patch) | |
| tree | 6f67dac8316d1c99bfa3e418ff2acaa82cbd8ba3 /net | |
| parent | 4976b816869168610853f5a49cecac852404681b (diff) | |
[NET]: Loopback device simplification.
Now that all the magic chain of static devices is gone from Space.c
The initialization of the one remaining static device (ie the loopback driver)
can be simplified.
One small change was to reduce possibility of failing the initialization if
allocation of private data failed by just going without statistics.
Diffstat (limited to 'net')
| -rw-r--r-- | net/core/dev.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 1ac07dc5077e..8a598f7f300c 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2981,7 +2981,6 @@ int unregister_netdevice(struct net_device *dev) */ static int __init net_dev_init(void) { - struct net_device *dev, **dp; int i, rc = -ENOMEM; BUG_ON(!dev_boot_phase); @@ -3027,75 +3026,6 @@ static int __init net_dev_init(void) add_timer(&samp_timer); #endif - /* - * Add the devices. - * If the call to dev->init fails, the dev is removed - * from the chain disconnecting the device until the - * next reboot. - * - * NB At boot phase networking is dead. No locking is required. - * But we still preserve dev_base_lock for sanity. - */ - - dp = &dev_base; - while ((dev = *dp) != NULL) { - spin_lock_init(&dev->queue_lock); - spin_lock_init(&dev->xmit_lock); -#ifdef CONFIG_NET_FASTROUTE - dev->fastpath_lock = RW_LOCK_UNLOCKED; -#endif - dev->xmit_lock_owner = -1; - dev->iflink = -1; - dev_hold(dev); - - /* - * Allocate name. If the init() fails - * the name will be reissued correctly. - */ - if (strchr(dev->name, '%')) - dev_alloc_name(dev, dev->name); - - /* - * Check boot time settings for the device. - */ - netdev_boot_setup_check(dev); - - if ( (dev->init && dev->init(dev)) || - netdev_register_sysfs(dev) ) { - /* - * It failed to come up. It will be unhooked later. - * dev_alloc_name can now advance to next suitable - * name that is checked next. - */ - dp = &dev->next; - } else { - dp = &dev->next; - dev->ifindex = dev_new_index(); - dev->reg_state = NETREG_REGISTERED; - if (dev->iflink == -1) - dev->iflink = dev->ifindex; - if (!dev->rebuild_header) - dev->rebuild_header = default_rebuild_header; - dev_init_scheduler(dev); - set_bit(__LINK_STATE_PRESENT, &dev->state); - } - } - - /* - * Unhook devices that failed to come up - */ - dp = &dev_base; - while ((dev = *dp) != NULL) { - if (dev->reg_state != NETREG_REGISTERED) { - write_lock_bh(&dev_base_lock); - *dp = dev->next; - write_unlock_bh(&dev_base_lock); - dev_put(dev); - } else { - dp = &dev->next; - } - } - dev_boot_phase = 0; probe_old_netdevs(); |
