summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorBrian Walsh <brian@walsh.ws>2006-08-15 07:43:19 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-26 06:08:39 +0200
commit370226449ced358e52d198081120826ef52c166b (patch)
treee436ccd6b5dea748bd432f84b71b0558b65511f0 /drivers/base
parentv4l-dev2: handle __must_check (diff)
downloadlinux-370226449ced358e52d198081120826ef52c166b.tar.xz
linux-370226449ced358e52d198081120826ef52c166b.zip
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: Brian Walsh <brian@walsh.ws> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index bc9f35c81691..b224bb43ff63 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -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);