提交 dbe9035d 编写于 作者: D Dmitry Torokhov 提交者: Greg Kroah-Hartman

[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: NDmitry Torokhov <dtor@mail.ru>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 b94dc6b5
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册