From: Philip Rakity <[email protected]>

The vmmc regulator should not rely on it being enabled in
the platform code.  Expliciitly enable and disable the
regulator.

Signed-off-by: Philip Rakity <[email protected]>
---
 drivers/mmc/host/sdhci.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index ac50d35..8c58865 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2908,7 +2908,8 @@ int sdhci_add_host(struct sdhci_host *host)
        if (IS_ERR(host->vmmc)) {
                pr_info("%s: no vmmc regulator found\n", mmc_hostname(mmc));
                host->vmmc = NULL;
-       }
+       } else
+               regulator_enable(host->vmmc);
 
 #ifdef CONFIG_REGULATOR
        if (host->vmmc) {
@@ -3165,8 +3166,10 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
        tasklet_kill(&host->card_tasklet);
        tasklet_kill(&host->finish_tasklet);
 
-       if (host->vmmc)
+       if (host->vmmc) {
+               regulator_disable(host->vmmc);
                regulator_put(host->vmmc);
+       }
 
        if (host->vqmmc) {
                regulator_disable(host->vqmmc);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to