aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2005-05-23 18:50:26 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-23 19:08:12 -0400
commit187a1a94d629621d1471b42308e63573b1150773 (patch)
tree3faa6b7762389edde92bbd2018e11c923df39f2a /drivers
parentab3fc403633c38aef5ef48844f8e5dbfee7c34f8 (diff)
[PATCH] driver core: restore event order for device_add()
As a result of the split of the kobject-registration and the corresponding hotplug event, the order of events for device_add() has changed. This restores the old order, cause it confused some userspace applications. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index d21eb7744496..fbc223486f81 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -245,6 +245,7 @@ int device_add(struct device *dev)
245 245
246 if ((error = kobject_add(&dev->kobj))) 246 if ((error = kobject_add(&dev->kobj)))
247 goto Error; 247 goto Error;
248 kobject_hotplug(&dev->kobj, KOBJ_ADD);
248 if ((error = device_pm_add(dev))) 249 if ((error = device_pm_add(dev)))
249 goto PMError; 250 goto PMError;
250 if ((error = bus_add_device(dev))) 251 if ((error = bus_add_device(dev)))
@@ -257,14 +258,13 @@ int device_add(struct device *dev)
257 /* notify platform of device entry */ 258 /* notify platform of device entry */
258 if (platform_notify) 259 if (platform_notify)
259 platform_notify(dev); 260 platform_notify(dev);
260
261 kobject_hotplug(&dev->kobj, KOBJ_ADD);
262 Done: 261 Done:
263 put_device(dev); 262 put_device(dev);
264 return error; 263 return error;
265 BusError: 264 BusError:
266 device_pm_remove(dev); 265 device_pm_remove(dev);
267 PMError: 266 PMError:
267 kobject_hotplug(&dev->kobj, KOBJ_REMOVE);
268 kobject_del(&dev->kobj); 268 kobject_del(&dev->kobj);
269 Error: 269 Error:
270 if (parent) 270 if (parent)