mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
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 <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
1aa506e437
commit
2f8d16a996
1 changed files with 7 additions and 0 deletions
|
@ -787,6 +787,13 @@ void device_del(struct device * dev)
|
||||||
device_remove_attrs(dev);
|
device_remove_attrs(dev);
|
||||||
bus_remove_device(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
|
/* Notify the platform of the removal, in case they
|
||||||
* need to do anything...
|
* need to do anything...
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue