From: Tejun Heo <htejun@gmail.com>
To: gregkh@suse.de, Jeff Garzik <jeff@garzik.org>,
linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: [PATCH] devres: release resources on device_del()
Date: Fri, 9 Mar 2007 19:34:19 +0900 [thread overview]
Message-ID: <20070309103419.GB32687@htj.dyndns.org> (raw)
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>
---
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
next reply other threads:[~2007-03-09 10:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-09 10:34 Tejun Heo [this message]
2007-03-09 10:36 ` Tejun Heo
2007-03-09 12:51 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070309103419.GB32687@htj.dyndns.org \
--to=htejun@gmail.com \
--cc=gregkh@suse.de \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®