[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070309103419.GB32687@htj.dyndns.org>
Date: Fri, 9 Mar 2007 19:34:19 +0900
From: Tejun Heo <htejun@...il.com>
To: gregkh@...e.de, Jeff Garzik <jeff@...zik.org>,
linux-kernel@...r.kernel.org, linux-ide@...r.kernel.org
Subject: [PATCH] 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@...il.com>
---
This one fixes oops on pata_platform and pata_legacy unload. libata
being the only user of devres at the moment. I think this can go
through libata-dev#upstream.
drivers/base/core.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index cf2a398..89ebe36 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...
*/
--
1.5.0.1
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists