diff options
author | Julia Lawall <julia@diku.dk> | 2011-04-22 16:11:21 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-24 03:08:54 -0400 |
commit | 683e7cdc207f71eef3ff46f5d36ec505c65fbbc6 (patch) | |
tree | ab1c2ebbb3c3b5faae511a84685e3ad6b5654e9a /drivers/video | |
parent | 94cd1ae2fd251fd8206c043ce91a99a45439a116 (diff) |
drivers/video: 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')
-rw-r--r-- | drivers/video/s3c-fb.c | 6 | ||||
-rw-r--r-- | drivers/video/sh7760fb.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 3fa7911ac906..d570e588f40a 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
@@ -1449,8 +1449,7 @@ err_ioremap: | |||
1449 | iounmap(sfb->regs); | 1449 | iounmap(sfb->regs); |
1450 | 1450 | ||
1451 | err_req_region: | 1451 | err_req_region: |
1452 | release_resource(sfb->regs_res); | 1452 | release_mem_region(sfb->regs_res->start, resource_size(sfb->regs_res)); |
1453 | kfree(sfb->regs_res); | ||
1454 | 1453 | ||
1455 | err_clk: | 1454 | err_clk: |
1456 | clk_disable(sfb->bus_clk); | 1455 | clk_disable(sfb->bus_clk); |
@@ -1486,8 +1485,7 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev) | |||
1486 | clk_disable(sfb->bus_clk); | 1485 | clk_disable(sfb->bus_clk); |
1487 | clk_put(sfb->bus_clk); | 1486 | clk_put(sfb->bus_clk); |
1488 | 1487 | ||
1489 | release_resource(sfb->regs_res); | 1488 | release_mem_region(sfb->regs_res->start, resource_size(sfb->regs_res)); |
1490 | kfree(sfb->regs_res); | ||
1491 | 1489 | ||
1492 | kfree(sfb); | 1490 | kfree(sfb); |
1493 | 1491 | ||
diff --git a/drivers/video/sh7760fb.c b/drivers/video/sh7760fb.c index 8fe19582c460..45e47d847163 100644 --- a/drivers/video/sh7760fb.c +++ b/drivers/video/sh7760fb.c | |||
@@ -551,8 +551,7 @@ out_unmap: | |||
551 | free_irq(par->irq, &par->vsync); | 551 | free_irq(par->irq, &par->vsync); |
552 | iounmap(par->base); | 552 | iounmap(par->base); |
553 | out_res: | 553 | out_res: |
554 | release_resource(par->ioarea); | 554 | release_mem_region(res->start, resource_size(res)); |
555 | kfree(par->ioarea); | ||
556 | out_fb: | 555 | out_fb: |
557 | framebuffer_release(info); | 556 | framebuffer_release(info); |
558 | return ret; | 557 | return ret; |
@@ -570,8 +569,7 @@ static int __devexit sh7760fb_remove(struct platform_device *dev) | |||
570 | if (par->irq >= 0) | 569 | if (par->irq >= 0) |
571 | free_irq(par->irq, par); | 570 | free_irq(par->irq, par); |
572 | iounmap(par->base); | 571 | iounmap(par->base); |
573 | release_resource(par->ioarea); | 572 | release_mem_region(par->ioarea->start, resource_size(par->ioarea)); |
574 | kfree(par->ioarea); | ||
575 | framebuffer_release(info); | 573 | framebuffer_release(info); |
576 | platform_set_drvdata(dev, NULL); | 574 | platform_set_drvdata(dev, NULL); |
577 | 575 | ||