From: Tejun Heo Date: Fri, 9 Mar 2007 10:34:19 +0000 (+0900) Subject: devres: release resources on device_del() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2f8d16a996da0b9be2536994aa7a825418364471;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git devres: release resources on device_del() 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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/base/core.c b/drivers/base/core.c index cf2a398aaaa1..89ebe3682726 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -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... */