[PATCH 2/31] Call platform_notify_remove later
Benjamin Herrenschmidt
benh at kernel.crashing.org
Tue Nov 7 18:22:33 EST 2006
Move the call to platform_notify_remove() to after the call to
bus_remove_device(), where it belongs. It's bogus to notify the platform
of removal while drivers are still attached to the device and possibly
still operating since the platform might use this callback to tear down
some resources used by the driver (ACPI bits, iommu table, ...)
Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Cc: "Brown, Len" <len.brown at intel.com>
Cc: Greg KH <greg at kroah.com>
Signed-off-by: Andrew Morton <akpm at osdl.org>
---
This patch is already in -mm under the name
call-platform_notify_remove-later.patch
drivers/base/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-cell/drivers/base/core.c
===================================================================
--- linux-cell.orig/drivers/base/core.c 2006-10-25 13:04:40.000000000 +1000
+++ linux-cell/drivers/base/core.c 2006-10-25 13:04:56.000000000 +1000
@@ -615,12 +615,13 @@ void device_del(struct device * dev)
device_remove_groups(dev);
device_remove_attrs(dev);
+ bus_remove_device(dev);
+
/* Notify the platform of the removal, in case they
* need to do anything...
*/
if (platform_notify_remove)
platform_notify_remove(dev);
- bus_remove_device(dev);
device_pm_remove(dev);
kobject_uevent(&dev->kobj, KOBJ_REMOVE);
kobject_del(&dev->kobj);
More information about the Linuxppc-dev
mailing list