[PATCH 27/36] Driver core: Call platform_notify_remove later



From: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxx>
Cc: "Brown, Len" <len.brown@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
drivers/base/core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index f544adc..5d11bbd 100644
--- a/drivers/base/core.c
+++ b/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);
--
1.4.4.1

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: legacy platform drivers and hotplugging
    ... Userspace will not code around your very personal idea of hotplug. ... My patch fixes all these issues, and make platform behave like a nice ... You disabled uevents which breaks udev and HAL setups, ... The basic problem with such legacy drivers is that they ...
    (Linux-Kernel)
  • Re: organizing drivers and tools into the platform builder tree
    ... one of these directories, the platform builder crashes as ... Another interesting point are platform independant drivers, ... public tree or 3rdparty ... which is common for all BSPs are located in this directory. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: organizing drivers and tools into the platform builder tree
    ... Another interesting point are platform independant drivers, ... public tree or 3rdparty ... which is common for all BSPs are located in this directory. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: organizing drivers and tools into the platform builder tree
    ... will be fixed in the next version of Platform Builder. ... Another interesting point are platform independant drivers, ... public tree or 3rdparty ... which is common for all BSPs are located in this directory. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: legacy platform drivers and hotplugging
    ... specific complaints about platform bus hotplugging. ... The basic problem with such legacy drivers is that they ... Which means that for these legacy drivers, ... it breaks coldplug too, as well as hotplug. ...
    (Linux-Kernel)