public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: David Brownell <david-b@pacbell.net>,
	linux-omap@vger.kernel.org, Grazvydas Ignotas <notasas@gmail.com>
Subject: [PATCH 04/12] OMAP2/3: mmc-twl4030: use correct controller in twl_mmc23_set_power
Date: Mon, 22 Jun 2009 14:42:17 +0300	[thread overview]
Message-ID: <20090622114217.28477.43701.stgit@localhost> (raw)
In-Reply-To: <20090622113422.28477.27052.stgit@localhost>

From: Grazvydas Ignotas <notasas@gmail.com>

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 <notasas@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/mmc-twl4030.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

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.


  parent reply	other threads:[~2009-06-22 11:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 11:36 [PATCH 00/12] Omap fixes for 2.6.31 Tony Lindgren
2009-06-22 11:38 ` [PATCH 01/12] OMAP1: Fix compilation of arch/arm/mach-omap1/mailbox.c Tony Lindgren
2009-06-22 11:39 ` [PATCH 02/12] OMAP1: Fix N770 MMC support Tony Lindgren
2009-06-22 11:41 ` [PATCH 03/12] OMAP1: remove duplicated #include Tony Lindgren
2009-06-22 11:42 ` Tony Lindgren [this message]
2009-06-22 11:43 ` [PATCH 05/12] OMAP2/3: omap mailbox: platform_get_irq() error ignored Tony Lindgren
2009-06-22 11:45 ` [PATCH 06/12] OMAP2/3: Add omap_type() for determining GP/EMU/HS Tony Lindgren
2009-06-22 11:46 ` [PATCH 07/12] OMAP3: SRAM size fix for HS/EMU devices Tony Lindgren
2009-06-22 11:47 ` [PATCH 08/12] OMAP3: DMA: Enable idlemodes for DMA OCP Tony Lindgren
2009-06-22 11:49 ` [PATCH 09/12] OMAP2/3: gpmc-onenand: correct use of async timings Tony Lindgren
2009-06-22 11:50 ` [PATCH 10/12] OMAP3: RX51: Use OneNAND sync read / write Tony Lindgren
2009-06-22 11:51 ` [PATCH 11/12] OMAP: IOMMU: function flush_iotlb_page is not flushing correct entry Tony Lindgren
2009-06-22 11:53 ` [PATCH 12/12] OMAP2/3: Initialize gpio debounce register Tony Lindgren
2009-06-23 13:57   ` [PATCH 13/12] OMAP: Fix IOMEM macro for assembly Tony Lindgren
2009-06-25 12:27 ` [PATCH 00/12] Omap fixes for 2.6.31 Russell King - ARM Linux
2009-06-25 12:35   ` Git pull request for omap-fixes for 2.6.31 (Re: [PATCH 00/12] Omap fixes for 2.6.31) Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090622114217.28477.43701.stgit@localhost \
    --to=tony@atomide.com \
    --cc=david-b@pacbell.net \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=notasas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox