[PATCH] Driver core: send hotplug event before adding class interfaces

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>
This commit is contained in:
Dmitry Torokhov 2005-09-15 02:01:37 -05:00 committed by Greg Kroah-Hartman
parent b94dc6b586
commit dbe9035d4f
1 changed files with 2 additions and 1 deletions

View File

@ -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);
@ -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)