From patchwork Mon Jun 22 11:42:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 31733 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5MBf8R8014095 for ; Mon, 22 Jun 2009 11:42:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753577AbZFVLmY (ORCPT ); Mon, 22 Jun 2009 07:42:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753992AbZFVLmY (ORCPT ); Mon, 22 Jun 2009 07:42:24 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:64577 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753577AbZFVLmY (ORCPT ); Mon, 22 Jun 2009 07:42:24 -0400 Received: from muru.com ([72.249.23.125] helo=[127.0.0.1]) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.68) (envelope-from ) id 1MIhus-000OKD-A7; Mon, 22 Jun 2009 11:42:26 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 72.249.23.125 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+G6+E2LcGHG6D4YynYXAvf Subject: [PATCH 04/12] OMAP2/3: mmc-twl4030: use correct controller in twl_mmc23_set_power To: linux-arm-kernel@lists.arm.linux.org.uk From: Tony Lindgren Cc: David Brownell , linux-omap@vger.kernel.org, Grazvydas Ignotas Date: Mon, 22 Jun 2009 14:42:17 +0300 Message-ID: <20090622114217.28477.43701.stgit@localhost> In-Reply-To: <20090622113422.28477.27052.stgit@localhost> References: <20090622113422.28477.27052.stgit@localhost> User-Agent: StGit/0.14.3.347.g594a MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Grazvydas Ignotas twl_mmc23_set_power() has MMC2 twl_mmc_controller hardcoded in it, which breaks MMC3. Find the right controller to use instead. Signed-off-by: Grazvydas Ignotas Cc: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/mmc-twl4030.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 9756a87..1541fd4 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -263,8 +263,19 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) { int ret = 0; - struct twl_mmc_controller *c = &hsmmc[1]; + struct twl_mmc_controller *c = NULL; struct omap_mmc_platform_data *mmc = dev->platform_data; + int i; + + for (i = 1; i < ARRAY_SIZE(hsmmc); i++) { + if (mmc == hsmmc[i].mmc) { + c = &hsmmc[i]; + break; + } + } + + if (c == NULL) + return -ENODEV; /* If we don't see a Vcc regulator, assume it's a fixed * voltage always-on regulator.