提交 37022644 编写于 作者: B Brian Walsh 提交者: Greg Kroah-Hartman

drivers/base: Platform notify needs to occur before drivers attach to the device

The platform_notify call for Arm and PPC architectures needs to be called
before the driver attaches to the device.  The problem only presents itself
when hotplugging certain devices while the driver is already loaded.
Signed-off-by: NBrian Walsh <brian@walsh.ws>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 8a6914ab
......@@ -424,6 +424,10 @@ int device_add(struct device *dev)
if ((error = kobject_add(&dev->kobj)))
goto Error;
/* notify platform of device entry */
if (platform_notify)
platform_notify(dev);
dev->uevent_attr.attr.name = "uevent";
dev->uevent_attr.attr.mode = S_IWUSR;
if (dev->driver)
......@@ -488,10 +492,6 @@ int device_add(struct device *dev)
class_intf->add_dev(dev, class_intf);
up(&dev->class->sem);
}
/* notify platform of device entry */
if (platform_notify)
platform_notify(dev);
Done:
kfree(class_name);
put_device(dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册