Skip to content

Commit

Permalink
[PATCH] Driver core: send hotplug event before adding class interfaces
Browse files Browse the repository at this point in the history
Move call to kobject_hotplug() above code that adds interfaces
to a class device, otherwise children's hotplug events may reach
userspace first.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Dmitry Torokhov authored and Greg Kroah-Hartman committed Oct 28, 2005
1 parent b94dc6b commit dbe9035
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ int class_device_add(struct class_device *class_dev)
class_name);
}

kobject_hotplug(&class_dev->kobj, KOBJ_ADD);

/* notify any interfaces this device is now here */
if (parent) {
down(&parent->sem);
Expand All @@ -533,7 +535,6 @@ int class_device_add(struct class_device *class_dev)
class_intf->add(class_dev);
up(&parent->sem);
}
kobject_hotplug(&class_dev->kobj, KOBJ_ADD);

register_done:
if (error && parent)
Expand Down

0 comments on commit dbe9035

Please sign in to comment.