Skip to content

Commit

Permalink
fbdev: sh-mobile-lcdc: fix potential Oops in SH-Mobile LCDC framebuff…
Browse files Browse the repository at this point in the history
…er 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: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Guennadi Liakhovetski authored and Paul Mundt committed Aug 4, 2010
1 parent 8a2b6be commit dba6f38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/video/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit dba6f38

Please sign in to comment.