Skip to contentSkip to conversation

mmc-twl4030: use correct controller in twl_mmc23_set_power

PATCH New Grazvydas Ignotas 2 participants 2 messages May 1, 2009 – Jun 2, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc-twl4030: use correct controller in twl_mmc23_set_power

twl_mmc23_set_power() has MMC2 twl_mmc_controller hardcoded in it, which breaks MMC3. Find the right controller to use instead.

---
 arch/arm/mach-omap2/mmc-twl4030.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mmc-twl4030.c +12 -1
index 46d6e9b..9928e72 100644
@@ -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.
Signature · 1 line
1.5.6.3
maintainer
#1 lore raw

PATCH 1/1 mmc-twl4030: use correct controller in twl_mmc23_set_power

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Initial commit ID (Likely to change): 8ecfa515facb0eb34102ddd6d7bfe0bfee898ea0

PatchWorks
http://patchwork.kernel.org/patch/21453/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=8ecfa515facb0eb34102ddd6d7bfe0bfee898ea0