diff options
author | Julia Lawall <julia@diku.dk> | 2011-04-22 20:11:23 +0000 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-24 16:09:03 +0900 |
commit | 08f3153861e3ce8ff28fa82efe50cfb744afee7e (patch) | |
tree | e4d7f5aa19b3ec876b26f2eb7dcaf9938455b4ef /drivers/video/s3c2410fb.c | |
parent | d2f6b7f7aaa245d6d96f9b3a95fc258f20c9e0a8 (diff) | |
download | linux-3.10-08f3153861e3ce8ff28fa82efe50cfb744afee7e.tar.gz linux-3.10-08f3153861e3ce8ff28fa82efe50cfb744afee7e.tar.bz2 linux-3.10-08f3153861e3ce8ff28fa82efe50cfb744afee7e.zip |
drivers/video/s3c2410fb.c: Convert release_resource to release_mem_region
Request_mem_region should be used with release_mem_region, not
release_resource.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@s exists@
expression e1,e2,e3,e4,e;
@@
*e4 = request_mem_region(e1,e2,e3)
... when != e4 = e
*release_resource(e4);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/s3c2410fb.c')
-rw-r--r-- | drivers/video/s3c2410fb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index 61c819e35f7..0aa13761de6 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c @@ -867,7 +867,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev, goto dealloc_fb; } - size = (res->end - res->start) + 1; + size = resource_size(res); info->mem = request_mem_region(res->start, size, pdev->name); if (info->mem == NULL) { dev_err(&pdev->dev, "failed to get memory region\n"); @@ -997,8 +997,7 @@ release_irq: release_regs: iounmap(info->io); release_mem: - release_resource(info->mem); - kfree(info->mem); + release_mem_region(res->start, size); dealloc_fb: platform_set_drvdata(pdev, NULL); framebuffer_release(fbinfo); @@ -1044,8 +1043,7 @@ static int __devexit s3c2410fb_remove(struct platform_device *pdev) iounmap(info->io); - release_resource(info->mem); - kfree(info->mem); + release_mem_region(info->mem->start, resource_size(info->mem)); platform_set_drvdata(pdev, NULL); framebuffer_release(fbinfo); |