diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-06-29 13:41:09 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-07 14:10:56 +0400 |
commit | d6b515028863a912d051d371b6d71e09f2a9ff19 (patch) | |
tree | f7baf3e3dab59cb6c1353b8a9b3bbd92ee933485 | |
parent | f497d0153a6b53b4cfd004de5f10b14bf630d852 (diff) | |
download | linux-d6b515028863a912d051d371b6d71e09f2a9ff19.tar.xz |
imxfb: use resource_size() macro
This fixes an off-by-one error. Also, use dev_err instead of printk
in probe() function.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/video/imxfb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index a8c41cb60fff..330857a8b318 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -661,7 +661,7 @@ static int __init imxfb_probe(struct platform_device *pdev) struct resource *res; int ret; - printk("i.MX Framebuffer driver\n"); + dev_info(&pdev->dev, "i.MX Framebuffer driver\n"); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) @@ -701,7 +701,7 @@ static int __init imxfb_probe(struct platform_device *pdev) fbi->regs = ioremap(res->start, resource_size(res)); if (fbi->regs == NULL) { - printk(KERN_ERR"Cannot map frame buffer registers\n"); + dev_err(&pdev->dev, "Cannot map frame buffer registers\n"); goto failed_ioremap; } @@ -771,7 +771,7 @@ failed_map: failed_getclock: iounmap(fbi->regs); failed_ioremap: - release_mem_region(res->start, res->end - res->start); + release_mem_region(res->start, resource_size(res)); failed_req: kfree(info->pseudo_palette); failed_init: @@ -802,7 +802,7 @@ static int __devexit imxfb_remove(struct platform_device *pdev) framebuffer_release(info); iounmap(fbi->regs); - release_mem_region(res->start, res->end - res->start + 1); + release_mem_region(res->start, resource_size(res)); clk_disable(fbi->clk); clk_put(fbi->clk); |