aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-09-15 03:01:37 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 12:52:50 -0400
commitdbe9035d4f690c44b55d3d0f1bc193e2c3fc57fa (patch)
tree56e46e581e95ae3bc8ca5473b4fd147c8b6d1f03
parentb94dc6b58667a73eeaf5cfd9c9e90dcd98743c5b (diff)
[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>
-rw-r--r--drivers/base/class.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index ce23dc8c18c5..8df58c57dd25 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -524,6 +524,8 @@ int class_device_add(struct class_device *class_dev)
524 class_name); 524 class_name);
525 } 525 }
526 526
527 kobject_hotplug(&class_dev->kobj, KOBJ_ADD);
528
527 /* notify any interfaces this device is now here */ 529 /* notify any interfaces this device is now here */
528 if (parent) { 530 if (parent) {
529 down(&parent->sem); 531 down(&parent->sem);
@@ -533,7 +535,6 @@ int class_device_add(struct class_device *class_dev)
533 class_intf->add(class_dev); 535 class_intf->add(class_dev);
534 up(&parent->sem); 536 up(&parent->sem);
535 } 537 }
536 kobject_hotplug(&class_dev->kobj, KOBJ_ADD);
537 538
538 register_done: 539 register_done:
539 if (error && parent) 540 if (error && parent)