summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/sa1100fb.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-10-17 16:01:12 +0200
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2017-10-17 16:01:12 +0200
commitdf6b228768db032608edbc58f87bc77d23f94952 (patch)
tree97a4d631f57c296e32a0805e30bfa5b230552a71 /drivers/video/fbdev/sa1100fb.c
parentvideo: sa1100fb: use devm_clk_get() (diff)
downloadlinux-df6b228768db032608edbc58f87bc77d23f94952.tar.xz
linux-df6b228768db032608edbc58f87bc77d23f94952.zip
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: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Diffstat (limited to 'drivers/video/fbdev/sa1100fb.c')
-rw-r--r--drivers/video/fbdev/sa1100fb.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/video/fbdev/sa1100fb.c b/drivers/video/fbdev/sa1100fb.c
index 1562d7607dd2..ab83970dbfd9 100644
--- a/drivers/video/fbdev/sa1100fb.c
+++ b/drivers/video/fbdev/sa1100fb.c
@@ -1217,29 +1217,28 @@ static int sa1100fb_probe(struct platform_device *pdev)
return -EINVAL;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
- if (irq < 0 || !res)
+ if (irq < 0)
return -EINVAL;
- if (!request_mem_region(res->start, resource_size(res), "LCD"))
- return -EBUSY;
-
fbi = sa1100fb_init_fbinfo(&pdev->dev);
ret = -ENOMEM;
if (!fbi)
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);
if (IS_ERR(fbi->clk)) {
ret = PTR_ERR(fbi->clk);
goto failed;
}
- fbi->base = ioremap(res->start, resource_size(res));
- if (!fbi->base)
- goto failed;
-
/* Initialize video memory */
ret = sa1100fb_map_video_memory(fbi);
if (ret)
@@ -1286,9 +1285,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
err_free_irq:
free_irq(irq, fbi);
failed:
- if (fbi)
- iounmap(fbi->base);
- release_mem_region(res->start, resource_size(res));
return ret;
}