Commit 78dd4f41 authored by Yangtao Li's avatar Yangtao Li Committed by Helge Deller

fbdev: imxfb: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 55dd7378
......@@ -869,7 +869,6 @@ static int imxfb_probe(struct platform_device *pdev)
struct imxfb_info *fbi;
struct lcd_device *lcd;
struct fb_info *info;
struct resource *res;
struct imx_fb_videomode *m;
const struct of_device_id *of_id;
struct device_node *display_np;
......@@ -886,10 +885,6 @@ static int imxfb_probe(struct platform_device *pdev)
if (of_id)
pdev->id_entry = of_id->data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
if (!info)
return -ENOMEM;
......@@ -971,7 +966,7 @@ static int imxfb_probe(struct platform_device *pdev)
goto failed_getclock;
}
fbi->regs = devm_ioremap_resource(&pdev->dev, res);
fbi->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(fbi->regs)) {
ret = PTR_ERR(fbi->regs);
goto failed_ioremap;
......
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