Commit 67870f0e authored by Stephen Hemminger's avatar Stephen Hemminger

[BPQETHER]: Remove pre-existing device discovery loop

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.
parent 0fefa047
......@@ -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;
}
......
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