Commit df6b2287 authored by Russell King's avatar Russell King Committed by Bartlomiej Zolnierkiewicz

video: sa1100fb: use devm_ioremap_resource()

Use devm_ioremap_resource() to map the LCD controller memory region,
and remove the unnecessary cleanup for this.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent e43064cc
...@@ -1217,29 +1217,28 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1217,29 +1217,28 @@ static int sa1100fb_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0 || !res) if (irq < 0)
return -EINVAL; return -EINVAL;
if (!request_mem_region(res->start, resource_size(res), "LCD"))
return -EBUSY;
fbi = sa1100fb_init_fbinfo(&pdev->dev); fbi = sa1100fb_init_fbinfo(&pdev->dev);
ret = -ENOMEM; ret = -ENOMEM;
if (!fbi) if (!fbi)
goto failed; goto failed;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
fbi->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(fbi->base)) {
ret = PTR_ERR(fbi->base);
goto failed;
}
fbi->clk = devm_clk_get(&pdev->dev, NULL); fbi->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(fbi->clk)) { if (IS_ERR(fbi->clk)) {
ret = PTR_ERR(fbi->clk); ret = PTR_ERR(fbi->clk);
goto failed; goto failed;
} }
fbi->base = ioremap(res->start, resource_size(res));
if (!fbi->base)
goto failed;
/* Initialize video memory */ /* Initialize video memory */
ret = sa1100fb_map_video_memory(fbi); ret = sa1100fb_map_video_memory(fbi);
if (ret) if (ret)
...@@ -1286,9 +1285,6 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1286,9 +1285,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
err_free_irq: err_free_irq:
free_irq(irq, fbi); free_irq(irq, fbi);
failed: failed:
if (fbi)
iounmap(fbi->base);
release_mem_region(res->start, resource_size(res));
return ret; return ret;
} }
......
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