From patchwork Tue Jun 28 08:45:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silesh C V X-Patchwork-Id: 923912 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5S8qBIO023065 for ; Tue, 28 Jun 2011 08:52:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757126Ab1F1Ilf (ORCPT ); Tue, 28 Jun 2011 04:41:35 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:49902 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757132Ab1F1IkP (ORCPT ); Tue, 28 Jun 2011 04:40:15 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p5S8eCn7015518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Jun 2011 03:40:12 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep33.itg.ti.com (8.13.7/8.13.8) with ESMTP id p5S8eCOh026336; Tue, 28 Jun 2011 03:40:12 -0500 (CDT) Received: from dlee73.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5S8eCFS005324; Tue, 28 Jun 2011 03:40:12 -0500 (CDT) Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE73.ent.ti.com (157.170.170.88) with Microsoft SMTP Server id 8.3.106.1; Tue, 28 Jun 2011 03:40:11 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id p5S8eBbI028496; Tue, 28 Jun 2011 03:40:11 -0500 Received: from localhost (fujutsu-desktop.apr.dhcp.ti.com [172.24.141.119]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id p5S8e9f09804; Tue, 28 Jun 2011 03:40:09 -0500 (CDT) From: Silesh C V To: CC: linux-arm-kernel@lists.infradead.org, kishore.kadiyala@ti.com, balajitk@ti.com, Silesh C V Subject: [PATCH] OMAP: HSMMC: Fix GPIO muxing Date: Tue, 28 Jun 2011 14:15:59 +0530 Message-ID: <1309250759-18472-1-git-send-email-silesh@ti.com> X-Mailer: git-send-email 1.7.4.1 MIME-Version: 1.0 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 (demeter1.kernel.org [140.211.167.41]); Tue, 28 Jun 2011 08:52:13 +0000 (UTC) Use generic gpio call to check the validity of the gpio. Note that this includes gpio 0 also which was missing before. Signed-off-by: Silesh C V Reviewed-by: Venkatraman S --- arch/arm/mach-omap2/hsmmc.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 66868c5..a9b45c7 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -213,12 +214,10 @@ static int nop_mmc_set_power(struct device *dev, int slot, int power_on, static inline void omap_hsmmc_mux(struct omap_mmc_platform_data *mmc_controller, int controller_nr) { - if ((mmc_controller->slots[0].switch_pin > 0) && \ - (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES)) + if (gpio_is_valid(mmc_controller->slots[0].switch_pin)) omap_mux_init_gpio(mmc_controller->slots[0].switch_pin, OMAP_PIN_INPUT_PULLUP); - if ((mmc_controller->slots[0].gpio_wp > 0) && \ - (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES)) + if (gpio_is_valid(mmc_controller->slots[0].gpio_wp)) omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp, OMAP_PIN_INPUT_PULLUP); if (cpu_is_omap34xx()) {