aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/mmc-twl4030.c13
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 9756a878fd90..1541fd4c8d0f 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,
263static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd) 263static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int vdd)
264{ 264{
265 int ret = 0; 265 int ret = 0;
266 struct twl_mmc_controller *c = &hsmmc[1]; 266 struct twl_mmc_controller *c = NULL;
267 struct omap_mmc_platform_data *mmc = dev->platform_data; 267 struct omap_mmc_platform_data *mmc = dev->platform_data;
268 int i;
269
270 for (i = 1; i < ARRAY_SIZE(hsmmc); i++) {
271 if (mmc == hsmmc[i].mmc) {
272 c = &hsmmc[i];
273 break;
274 }
275 }
276
277 if (c == NULL)
278 return -ENODEV;
268 279
269 /* If we don't see a Vcc regulator, assume it's a fixed 280 /* If we don't see a Vcc regulator, assume it's a fixed
270 * voltage always-on regulator. 281 * voltage always-on regulator.