提交 dba6f385 编写于 作者: G Guennadi Liakhovetski 提交者: Paul Mundt

fbdev: sh-mobile-lcdc: fix potential Oops in SH-Mobile LCDC framebuffer driver

sh_mobile_lcdc_setup_clocks() can perform IO, therefore it has to be called
after ioremap(). Also check return code of ioremap() and use resource_size()
instead of open-coding it.
Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: NMagnus Damm <damm@opensource.se>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 8a2b6bef
......@@ -1020,14 +1020,16 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
goto err1;
}
priv->base = ioremap_nocache(res->start, resource_size(res));
if (!priv->base)
goto err1;
error = sh_mobile_lcdc_setup_clocks(pdev, pdata->clock_source, priv);
if (error) {
dev_err(&pdev->dev, "unable to setup clocks\n");
goto err1;
}
priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1);
for (i = 0; i < j; i++) {
cfg = &priv->ch[i].cfg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册