Commit d2f6b7f7 authored by Julia Lawall's avatar Julia Lawall Committed by Paul Mundt

drivers/video/sm501fb.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 683e7cdc
...@@ -1625,22 +1625,22 @@ static int sm501fb_start(struct sm501fb_info *info, ...@@ -1625,22 +1625,22 @@ static int sm501fb_start(struct sm501fb_info *info,
return 0; /* everything is setup */ return 0; /* everything is setup */
err_mem_res: err_mem_res:
release_resource(info->fbmem_res); release_mem_region(info->fbmem_res->start,
kfree(info->fbmem_res); resource_size(info->fbmem_res));
err_regs2d_map: err_regs2d_map:
iounmap(info->regs2d); iounmap(info->regs2d);
err_regs2d_res: err_regs2d_res:
release_resource(info->regs2d_res); release_mem_region(info->regs2d_res->start,
kfree(info->regs2d_res); resource_size(info->regs2d_res));
err_regs_map: err_regs_map:
iounmap(info->regs); iounmap(info->regs);
err_regs_res: err_regs_res:
release_resource(info->regs_res); release_mem_region(info->regs_res->start,
kfree(info->regs_res); resource_size(info->regs_res));
err_release: err_release:
return ret; return ret;
...@@ -1652,16 +1652,16 @@ static void sm501fb_stop(struct sm501fb_info *info) ...@@ -1652,16 +1652,16 @@ static void sm501fb_stop(struct sm501fb_info *info)
sm501_unit_power(info->dev->parent, SM501_GATE_DISPLAY, 0); sm501_unit_power(info->dev->parent, SM501_GATE_DISPLAY, 0);
iounmap(info->fbmem); iounmap(info->fbmem);
release_resource(info->fbmem_res); release_mem_region(info->fbmem_res->start,
kfree(info->fbmem_res); resource_size(info->fbmem_res));
iounmap(info->regs2d); iounmap(info->regs2d);
release_resource(info->regs2d_res); release_mem_region(info->regs2d_res->start,
kfree(info->regs2d_res); resource_size(info->regs2d_res));
iounmap(info->regs); iounmap(info->regs);
release_resource(info->regs_res); release_mem_region(info->regs_res->start,
kfree(info->regs_res); resource_size(info->regs_res));
} }
static int sm501fb_init_fb(struct fb_info *fb, static int sm501fb_init_fb(struct fb_info *fb,
......
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