diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-06-29 05:41:09 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-07 06:10:56 -0400 |
commit | d6b515028863a912d051d371b6d71e09f2a9ff19 (patch) | |
tree | f7baf3e3dab59cb6c1353b8a9b3bbd92ee933485 | |
parent | f497d0153a6b53b4cfd004de5f10b14bf630d852 (diff) |
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) | |||
661 | struct resource *res; | 661 | struct resource *res; |
662 | int ret; | 662 | int ret; |
663 | 663 | ||
664 | printk("i.MX Framebuffer driver\n"); | 664 | dev_info(&pdev->dev, "i.MX Framebuffer driver\n"); |
665 | 665 | ||
666 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 666 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
667 | if (!res) | 667 | if (!res) |
@@ -701,7 +701,7 @@ static int __init imxfb_probe(struct platform_device *pdev) | |||
701 | 701 | ||
702 | fbi->regs = ioremap(res->start, resource_size(res)); | 702 | fbi->regs = ioremap(res->start, resource_size(res)); |
703 | if (fbi->regs == NULL) { | 703 | if (fbi->regs == NULL) { |
704 | printk(KERN_ERR"Cannot map frame buffer registers\n"); | 704 | dev_err(&pdev->dev, "Cannot map frame buffer registers\n"); |
705 | goto failed_ioremap; | 705 | goto failed_ioremap; |
706 | } | 706 | } |
707 | 707 | ||
@@ -771,7 +771,7 @@ failed_map: | |||
771 | failed_getclock: | 771 | failed_getclock: |
772 | iounmap(fbi->regs); | 772 | iounmap(fbi->regs); |
773 | failed_ioremap: | 773 | failed_ioremap: |
774 | release_mem_region(res->start, res->end - res->start); | 774 | release_mem_region(res->start, resource_size(res)); |
775 | failed_req: | 775 | failed_req: |
776 | kfree(info->pseudo_palette); | 776 | kfree(info->pseudo_palette); |
777 | failed_init: | 777 | failed_init: |
@@ -802,7 +802,7 @@ static int __devexit imxfb_remove(struct platform_device *pdev) | |||
802 | framebuffer_release(info); | 802 | framebuffer_release(info); |
803 | 803 | ||
804 | iounmap(fbi->regs); | 804 | iounmap(fbi->regs); |
805 | release_mem_region(res->start, res->end - res->start + 1); | 805 | release_mem_region(res->start, resource_size(res)); |
806 | clk_disable(fbi->clk); | 806 | clk_disable(fbi->clk); |
807 | clk_put(fbi->clk); | 807 | clk_put(fbi->clk); |
808 | 808 | ||