devres: release resources on device_del()
authorTejun Heo <htejun@gmail.com>
Fri, 9 Mar 2007 10:34:19 +0000 (19:34 +0900)
committerJeff Garzik <jeff@garzik.org>
Fri, 9 Mar 2007 13:41:16 +0000 (08:41 -0500)
Some platform devices are driven without driver attached, so managed
resources can be acquired without driver attached.  Make sure such
resources are released by calling devres_release_all() in
device_del().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/base/core.c

index cf2a398aaaa1f6c0113bb1b58793e8d14b940129..89ebe368272616be7164269bcb4637b3bb18c307 100644 (file)
@@ -787,6 +787,13 @@ void device_del(struct device * dev)
        device_remove_attrs(dev);
        bus_remove_device(dev);
 
+       /*
+        * Some platform devices are driven without driver attached
+        * and managed resources may have been acquired.  Make sure
+        * all resources are released.
+        */
+       devres_release_all(dev);
+
        /* Notify the platform of the removal, in case they
         * need to do anything...
         */