[NET]: Create netdev attribute_groups with class_device_add

Atomically create attributes when class device is added. This avoids
the race between registering class_device (which generates hotplug
event), and the creation of attribute groups.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Stephen Hemminger
2006-05-06 17:56:03 -07:00
committed by David S. Miller
parent 1498221d51
commit fe9925b551
3 changed files with 15 additions and 38 deletions

View File

@@ -3043,11 +3043,11 @@ void netdev_run_todo(void)
switch(dev->reg_state) {
case NETREG_REGISTERING:
dev->reg_state = NETREG_REGISTERED;
err = netdev_register_sysfs(dev);
if (err)
printk(KERN_ERR "%s: failed sysfs registration (%d)\n",
dev->name, err);
dev->reg_state = NETREG_REGISTERED;
break;
case NETREG_UNREGISTERING: