]> git.hungrycats.org Git - linux/commitdiff
[BPQETHER]: Remove pre-existing device discovery loop
authorStephen Hemminger <shemminger@osdl.org>
Tue, 13 Jan 2004 08:38:13 +0000 (00:38 -0800)
committerStephen Hemminger <shemminger@osdl.org>
Tue, 13 Jan 2004 08:38:13 +0000 (00:38 -0800)
Remove duplicate/conflicting code now that netdev_register_notifier replays the
device registration events. Reorder initialization to avoid having to simplify error unwind
if /proc creation failed.

drivers/net/hamradio/bpqether.c

index 93865624e6210171906a00ebe5e853265a09b856..b0bf84f29bec91bb2c612f781737e6633e0e703d 100644 (file)
@@ -606,33 +606,20 @@ static int bpq_device_event(struct notifier_block *this,unsigned long event, voi
  */
 static int __init bpq_init_driver(void)
 {
-       struct net_device *dev;
-
-       dev_add_pack(&bpq_packet_type);
-
-       register_netdevice_notifier(&bpq_dev_notifier);
-
-       printk(banner);
-
 #ifdef CONFIG_PROC_FS
        if (!proc_net_fops_create("bpqether", S_IRUGO, &bpq_info_fops)) {
                printk(KERN_ERR
                        "bpq: cannot create /proc/net/bpqether entry.\n");
-               unregister_netdevice_notifier(&bpq_dev_notifier);
-               dev_remove_pack(&bpq_packet_type);
                return -ENOENT;
        }
 #endif  /* CONFIG_PROC_FS */
 
-       rtnl_lock();
-       for (dev = dev_base; dev != NULL; dev = dev->next) {
-               if (dev_is_ethdev(dev) && bpq_new_device(dev)) {
-                       printk(KERN_ERR
-                              "bpq: cannot setup dev for '%s'\n",
-                              dev->name);
-               }
-       }
-       rtnl_unlock();
+       dev_add_pack(&bpq_packet_type);
+
+       register_netdevice_notifier(&bpq_dev_notifier);
+
+       printk(banner);
+
        return 0;
 }