Commit 08f31538 authored by Julia Lawall's avatar Julia Lawall Committed by Paul Mundt

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent d2f6b7f7
...@@ -867,7 +867,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev, ...@@ -867,7 +867,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev,
goto dealloc_fb; goto dealloc_fb;
} }
size = (res->end - res->start) + 1; size = resource_size(res);
info->mem = request_mem_region(res->start, size, pdev->name); info->mem = request_mem_region(res->start, size, pdev->name);
if (info->mem == NULL) { if (info->mem == NULL) {
dev_err(&pdev->dev, "failed to get memory region\n"); dev_err(&pdev->dev, "failed to get memory region\n");
...@@ -997,8 +997,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev, ...@@ -997,8 +997,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev,
release_regs: release_regs:
iounmap(info->io); iounmap(info->io);
release_mem: release_mem:
release_resource(info->mem); release_mem_region(res->start, size);
kfree(info->mem);
dealloc_fb: dealloc_fb:
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
...@@ -1044,8 +1043,7 @@ static int __devexit s3c2410fb_remove(struct platform_device *pdev) ...@@ -1044,8 +1043,7 @@ static int __devexit s3c2410fb_remove(struct platform_device *pdev)
iounmap(info->io); iounmap(info->io);
release_resource(info->mem); release_mem_region(info->mem->start, resource_size(info->mem));
kfree(info->mem);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
framebuffer_release(fbinfo); framebuffer_release(fbinfo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment