Skip to content

Commit 78dd4f4

Browse files
bbkzzhdeller
authored andcommitted
fbdev: imxfb: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 55dd737 commit 78dd4f4

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/video/fbdev/imxfb.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,6 @@ static int imxfb_probe(struct platform_device *pdev)
869869
struct imxfb_info *fbi;
870870
struct lcd_device *lcd;
871871
struct fb_info *info;
872-
struct resource *res;
873872
struct imx_fb_videomode *m;
874873
const struct of_device_id *of_id;
875874
struct device_node *display_np;
@@ -886,10 +885,6 @@ static int imxfb_probe(struct platform_device *pdev)
886885
if (of_id)
887886
pdev->id_entry = of_id->data;
888887

889-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
890-
if (!res)
891-
return -ENODEV;
892-
893888
info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
894889
if (!info)
895890
return -ENOMEM;
@@ -971,7 +966,7 @@ static int imxfb_probe(struct platform_device *pdev)
971966
goto failed_getclock;
972967
}
973968

974-
fbi->regs = devm_ioremap_resource(&pdev->dev, res);
969+
fbi->regs = devm_platform_ioremap_resource(pdev, 0);
975970
if (IS_ERR(fbi->regs)) {
976971
ret = PTR_ERR(fbi->regs);
977972
goto failed_ioremap;

0 commit comments

Comments
 (0)