* [PATCH] fbdev: sh-mobile-lcdc: fix potential Oops in SH-Mobile LCDC
@ 2010-06-30 9:26 Guennadi Liakhovetski
0 siblings, 0 replies; only message in thread
From: Guennadi Liakhovetski @ 2010-06-30 9:26 UTC (permalink / raw)
To: linux-fbdev
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>
---
drivers/video/sh_mobile_lcdcfb.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index e8c7699..1ece226 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -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;
--
1.6.2.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-30 9:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-30 9:26 [PATCH] fbdev: sh-mobile-lcdc: fix potential Oops in SH-Mobile LCDC Guennadi Liakhovetski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).