From: Dmitry Torokhov Date: Thu, 15 Sep 2005 07:01:37 +0000 (-0500) Subject: [PATCH] Driver core: send hotplug event before adding class interfaces X-Git-Tag: v2.6.15-rc1~731^2~28^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dbe9035d4f690c44b55d3d0f1bc193e2c3fc57fa;p=platform%2Fkernel%2Flinux-3.10.git [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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/class.c b/drivers/base/class.c index ce23dc8..8df58c5 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -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)