public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver core: restore event order for device_add()
@ 2005-05-19 20:50 Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2005-05-19 20:50 UTC (permalink / raw)
  To: Greg KH; +Cc: David Zeuthen, linux-kernel

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>
---

--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -248,6 +248,7 @@ int device_add(struct device *dev)
 
 	if ((error = kobject_add(&dev->kobj)))
 		goto Error;
+	kobject_hotplug(&dev->kobj, KOBJ_ADD);
 	if ((error = device_pm_add(dev)))
 		goto PMError;
 	if ((error = bus_add_device(dev)))
@@ -260,14 +261,13 @@ int device_add(struct device *dev)
 	/* notify platform of device entry */
 	if (platform_notify)
 		platform_notify(dev);
-
-	kobject_hotplug(&dev->kobj, KOBJ_ADD);
  Done:
 	put_device(dev);
 	return error;
  BusError:
 	device_pm_remove(dev);
  PMError:
+	kobject_hotplug(&dev->kobj, KOBJ_REMOVE);
 	kobject_del(&dev->kobj);
  Error:
 	if (parent)


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH] driver core: restore event order for device_add()
@ 2005-05-23 22:50 Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2005-05-23 22:50 UTC (permalink / raw)
  To: torvalds, Andrew Morton; +Cc: linux-kernel, kay.sievers

Linus, please apply this to your 2.6.12-rc4 git tree, the SCSI, HAL, and
udev people need to restore the original order of hotplug events (as
2.6.11 and before kernels provide) until they work out the details of
how to do this better.

----------

From: Kay Sievers <kay.sievers@vrfy.org>
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>

---
 drivers/base/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

--- gregkh-2.6.orig/drivers/base/core.c	2005-05-23 14:59:20.000000000 -0700
+++ gregkh-2.6/drivers/base/core.c	2005-05-23 14:59:23.000000000 -0700
@@ -245,6 +245,7 @@
 
 	if ((error = kobject_add(&dev->kobj)))
 		goto Error;
+	kobject_hotplug(&dev->kobj, KOBJ_ADD);
 	if ((error = device_pm_add(dev)))
 		goto PMError;
 	if ((error = bus_add_device(dev)))
@@ -257,14 +258,13 @@
 	/* notify platform of device entry */
 	if (platform_notify)
 		platform_notify(dev);
-
-	kobject_hotplug(&dev->kobj, KOBJ_ADD);
  Done:
 	put_device(dev);
 	return error;
  BusError:
 	device_pm_remove(dev);
  PMError:
+	kobject_hotplug(&dev->kobj, KOBJ_REMOVE);
 	kobject_del(&dev->kobj);
  Error:
 	if (parent)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-23 23:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19 20:50 [PATCH] driver core: restore event order for device_add() Kay Sievers
  -- strict thread matches above, loose matches on Subject: below --
2005-05-23 22:50 Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox