sh_mobile_meram: Safely disable MERAM operation when not initialized
authorDamian <dhobsong@igel.co.jp>
Tue, 24 May 2011 07:01:21 +0000 (07:01 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 25 May 2011 02:43:11 +0000 (11:43 +0900)
If the MERAM platform data is defined, but the MERAM has not been
properly initaliazed we need to safely fall back to non-MERAM operation.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/video/sh_mobile_lcdcfb.c

index 1c652da348eac950ee0c09f81c71c62673dcef72..edf0d32b26c4a021a47cf3aa460dd02067fbde08 100644 (file)
@@ -610,7 +610,8 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
                pitch = ch->info->fix.line_length;
 
                /* test if we can enable meram */
-               if (ch->cfg.meram_cfg && priv->meram_dev) {
+               if (ch->cfg.meram_cfg && priv->meram_dev &&
+                               priv->meram_dev->ops) {
                        struct sh_mobile_meram_cfg *cfg;
                        struct sh_mobile_meram_info *mdev;
                        unsigned long icb_addr_y, icb_addr_c;