mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 3/3] drivers/mmc/host/pxamci.c: Convert release_resource to release_mem_region
@ 2011-03-22 17:14 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2011-03-22 17:14 UTC (permalink / raw)
  To: Chris Ball
  Cc: kernel-janitors, Andrew Morton, Martin K. Petersen,
	Linus Walleij, Marek Vasut, linux-mmc, linux-kernel

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/pxamci.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 7257738..b6e7e64 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -774,7 +774,7 @@ err_gpio_ro:
 	}
 	if (mmc)
 		mmc_free_host(mmc);
-	release_resource(r);
+	release_mem_region(r->start, resource_size(r));
 	return ret;
 }
 
@@ -824,7 +824,7 @@ static int pxamci_remove(struct platform_device *pdev)
 
 		clk_put(host->clk);
 
-		release_resource(host->res);
+		release_mem_region(host->res->start, resource_size(host->res));
 
 		mmc_free_host(mmc);
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-22 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-22 17:14 [PATCH 3/3] drivers/mmc/host/pxamci.c: Convert release_resource to release_mem_region Julia Lawall

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®