From: Adrian Hunter Date: Tue, 24 Mar 2009 12:15:54 +0000 (+0000) Subject: OMAP: mmc_twl4030 nicely disable vmmc_aux X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0268abf95f935c2fe45f778b2a223685e68c7823;p=linux-2.6-omap-h63xx.git OMAP: mmc_twl4030 nicely disable vmmc_aux The MMC driver turns the power off before it turns it on. To avoid regulator warnings, vmmc_aux must only be disabled if it has previously been enabled. Signed-off-by: Adrian Hunter Acked-by: David Brownell Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 2ff50f05f49..cb56fe270ab 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -305,7 +305,7 @@ static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int v ret = mmc_regulator_set_ocr(c->vcc, 0); } } else { - if (c->vcc_aux) + if (c->vcc_aux && (ret = regulator_is_enabled(c->vcc_aux)) > 0) ret = regulator_disable(c->vcc_aux); if (ret == 0) ret = mmc_regulator_set_ocr(c->vcc, 0);