From patchwork Tue May 24 07:01:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damian Hobson-Garcia X-Patchwork-Id: 810982 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4O6wr7N024453 for ; Tue, 24 May 2011 06:59:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753464Ab1EXG64 (ORCPT ); Tue, 24 May 2011 02:58:56 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:42961 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753283Ab1EXG64 (ORCPT ); Tue, 24 May 2011 02:58:56 -0400 Received: by pzk9 with SMTP id 9so2870597pzk.19 for ; Mon, 23 May 2011 23:58:55 -0700 (PDT) Received: by 10.142.120.15 with SMTP id s15mr1079239wfc.141.1306220335623; Mon, 23 May 2011 23:58:55 -0700 (PDT) Received: from localhost.localdomain (mailhost.igel.co.jp [219.106.231.130]) by mx.google.com with ESMTPS id c14sm4828215pbu.84.2011.05.23.23.58.54 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 May 2011 23:58:55 -0700 (PDT) From: Damian Hobson-Garcia To: lethal@linux-sh.org Cc: magnus.damm@gmail.com, linux-sh@vger.kernel.org, taki@igel.co.jp, matsu@igel.co.jp, Damian Hobson-Garcia Subject: [PATCH 2/3] sh_mobile_meram: Safely disable MERAM operation when not initialized Date: Tue, 24 May 2011 16:01:21 +0900 Message-Id: <1306220482-29107-3-git-send-email-dhobsong@igel.co.jp> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1306220482-29107-1-git-send-email-dhobsong@igel.co.jp> References: <1306220482-29107-1-git-send-email-dhobsong@igel.co.jp> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 24 May 2011 06:59:44 +0000 (UTC) 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 --- drivers/video/sh_mobile_lcdcfb.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index 1c652da..edf0d32 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -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;