Skip to content

Commit

Permalink
drivers/base: Platform notify needs to occur before drivers attach to…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Brian Walsh authored and Greg Kroah-Hartman committed Sep 26, 2006
1 parent 8a6914a commit 3702264
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3702264

Please sign in to comment.