From patchwork Sun Aug 14 19:47:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Belisko X-Patchwork-Id: 1066132 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7EJll7v004404 for ; Sun, 14 Aug 2011 19:47:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100Ab1HNTrX (ORCPT ); Sun, 14 Aug 2011 15:47:23 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:64618 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754976Ab1HNTrV (ORCPT ); Sun, 14 Aug 2011 15:47:21 -0400 Received: by fxh19 with SMTP id 19so3236713fxh.19 for ; Sun, 14 Aug 2011 12:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=+8JDQK6RX9G8nYfmXNlRekQ5rRzRAgaI5Op8WfZzsTo=; b=iWI+EYCpdk/p1tVvV8qbGTn9U1AC2VTiXw3Fiv2ah+nm2clJB8fUrxMwURaJ3boUO3 W/igDeAL0G4Af2JsCZUyQFYJDN5KrYV7gLJFr32qW+Gc9NhRfA/JAQGo7dQat1ulLYES Uwp4VCSsSNBkZCypSairtxPcol1F7+XXVjy+M= Received: by 10.223.8.197 with SMTP id i5mr4395281fai.67.1313351239733; Sun, 14 Aug 2011 12:47:19 -0700 (PDT) Received: from localhost.localdomain ([92.52.13.74]) by mx.google.com with ESMTPS id e8sm2332200fah.10.2011.08.14.12.47.18 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Aug 2011 12:47:19 -0700 (PDT) From: Marek Belisko To: tony@atomide.com, linux@arm.linux.org.uk Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Marek Belisko Subject: [PATCH] omap2+:panda: Make hdmi_mux_init more robust. Date: Sun, 14 Aug 2011 21:47:15 +0200 Message-Id: <1313351235-11400-1-git-send-email-marek.belisko@open-nandra.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 14 Aug 2011 19:47:48 +0000 (UTC) Add error checking to omap4_panda_hdmi_mux_init function to avoid problems when mux fails. Signed-off-by: Marek Belisko --- arch/arm/mach-omap2/board-omap4panda.c | 38 +++++++++++++++++++++++-------- 1 files changed, 28 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 9aaa960..59fba7c 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -485,18 +485,33 @@ int __init omap4_panda_dvi_init(void) } -static void omap4_panda_hdmi_mux_init(void) +static int omap4_panda_hdmi_mux_init(void) { + int ret; /* PAD0_HDMI_HPD_PAD1_HDMI_CEC */ - omap_mux_init_signal("hdmi_hpd", - OMAP_PIN_INPUT_PULLUP); - omap_mux_init_signal("hdmi_cec", - OMAP_PIN_INPUT_PULLUP); + ret = omap_mux_init_signal("hdmi_hpd", + OMAP_PIN_INPUT_PULLUP); + if (ret) + goto err; + + ret = omap_mux_init_signal("hdmi_cec", + OMAP_PIN_INPUT_PULLUP); + if (ret) + goto err; + /* PAD0_HDMI_DDC_SCL_PAD1_HDMI_DDC_SDA */ - omap_mux_init_signal("hdmi_ddc_scl", - OMAP_PIN_INPUT_PULLUP); - omap_mux_init_signal("hdmi_ddc_sda", - OMAP_PIN_INPUT_PULLUP); + ret = omap_mux_init_signal("hdmi_ddc_scl", + OMAP_PIN_INPUT_PULLUP); + if (ret) + goto err; + + ret = omap_mux_init_signal("hdmi_ddc_sda", + OMAP_PIN_INPUT_PULLUP); + if (ret) + goto err; + return 0; +err: + return ret; } static struct gpio panda_hdmi_gpios[] = { @@ -550,7 +565,10 @@ void omap4_panda_display_init(void) if (r) pr_err("error initializing panda DVI\n"); - omap4_panda_hdmi_mux_init(); + r = omap4_panda_hdmi_mux_init(); + if (r) + pr_err("error initializing panda HDMI\n"); + omap_display_init(&omap4_panda_dss_data); }