Subject: Call platform_notify_remove later From: Benjamin Herrenschmidt 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 Cc: "Brown, Len" Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Arnd Bergmann --- 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-2.6/drivers/base/core.c =================================================================== --- linux-2.6.orig/drivers/base/core.c +++ linux-2.6/drivers/base/core.c @@ -467,12 +467,13 @@ void device_del(struct device * dev) } device_remove_file(dev, &dev->uevent_attr); + 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);