From: Julia Lawall <julia@diku.dk>
To: Nicolas Pitre <nico@fluxnic.net>
Cc: kernel-janitors@vger.kernel.org, Chris Ball <cjb@laptop.org>,
Andrew Morton <akpm@linux-foundation.org>,
Michal Miroslaw <mirq-linux@rere.qmqm.pl>,
Anton Vorontsov <cbouatmailru@gmail.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Sascha Sommer <saschasommer@freenet.de>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] drivers/mmc/host/mvsdio.c: Convert release_resource to release_mem_region
Date: Tue, 22 Mar 2011 18:14:53 +0100 [thread overview]
Message-ID: <1300814095-25278-1-git-send-email-julia@diku.dk> (raw)
Request_mem_region should be used with release_mem_region, not
release_resource.
A semantic patch that partially fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@b@
expression x,E;
@@
x = request_mem_region(x->start,...)
... when != release_mem_region(x->start,...)
when != x = E
(
- release_resource(x);
- kfree(x);
+ release_mem_region(x->start,resource_size(x));
|
?- release_resource(x);
+ release_mem_region(x->start,resource_size(x));
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/mmc/host/mvsdio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index a5bf60e..4606087 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -825,7 +825,7 @@ out:
iounmap(host->base);
}
if (r)
- release_resource(r);
+ release_mem_region(r->start, resource_size(r));
if (mmc)
mmc_free_host(mmc);
@@ -850,7 +850,7 @@ static int __exit mvsd_remove(struct platform_device *pdev)
del_timer_sync(&host->timer);
mvsd_power_down(host);
iounmap(host->base);
- release_resource(host->res);
+ release_mem_region(host->res->start, resource_size(host->res));
mmc_free_host(mmc);
}
platform_set_drvdata(pdev, NULL);
next reply other threads:[~2011-03-22 17:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 17:14 Julia Lawall [this message]
2011-03-22 19:04 ` Nicolas Pitre
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=1300814095-25278-1-git-send-email-julia@diku.dk \
--to=julia@diku.dk \
--cc=akpm@linux-foundation.org \
--cc=cbouatmailru@gmail.com \
--cc=cjb@laptop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=nico@fluxnic.net \
--cc=saschasommer@freenet.de \
/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®