From akpm@osdl.org Wed Nov 8 19:46:19 2006 Message-Id: <200611090346.kA93kES1003517@shell0.pdx.osdl.net> From: Benjamin Herrenschmidt Subject: Driver core: Call platform_notify_remove later To: greg@kroah.com Cc: akpm@osdl.org, benh@kernel.crashing.org, len.brown@intel.com Date: Wed, 08 Nov 2006 19:46:14 -0800 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" Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- gregkh-2.6.orig/drivers/base/core.c +++ gregkh-2.6/drivers/base/core.c @@ -682,6 +682,7 @@ void device_del(struct device * dev) device_remove_file(dev, &dev->uevent_attr); 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... @@ -691,7 +692,6 @@ void device_del(struct device * dev) if (dev->bus) blocking_notifier_call_chain(&dev->bus->bus_notifier, BUS_NOTIFY_DEL_DEVICE, dev); - bus_remove_device(dev); device_pm_remove(dev); kobject_uevent(&dev->kobj, KOBJ_REMOVE); kobject_del(&dev->kobj);