aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@nokia.com>2010-02-15 13:03:34 -0500
committerTony Lindgren <tony@atomide.com>2010-02-15 13:03:34 -0500
commit6da20c89af64b75302399369a90b9d50c1a87665 (patch)
treeb5986493f8d2e1c06af6aa3f63944bdc2dc45d03
parent4380eea266940a82e5b8edd5c16ce0289679bcfe (diff)
omap_hsmmc: Ensure regulator enable / disable are paired
Stop using 'regulator_is_enabled()' and just pair enables with disables so that the regulator reference counts can work correctly. Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--drivers/mmc/host/omap_hsmmc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index cb94044f3fc4..d2fad587f371 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -296,11 +296,8 @@ static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on,
296 ret = mmc_regulator_set_ocr(host->vcc, 0); 296 ret = mmc_regulator_set_ocr(host->vcc, 0);
297 } 297 }
298 } else { 298 } else {
299 if (host->vcc_aux) { 299 if (host->vcc_aux)
300 ret = regulator_is_enabled(host->vcc_aux); 300 ret = regulator_disable(host->vcc_aux);
301 if (ret > 0)
302 ret = regulator_disable(host->vcc_aux);
303 }
304 if (ret == 0) 301 if (ret == 0)
305 ret = mmc_regulator_set_ocr(host->vcc, 0); 302 ret = mmc_regulator_set_ocr(host->vcc, 0);
306 } 303 }
@@ -1975,7 +1972,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
1975 host->slot_id = 0; 1972 host->slot_id = 0;
1976 host->mapbase = res->start; 1973 host->mapbase = res->start;
1977 host->base = ioremap(host->mapbase, SZ_4K); 1974 host->base = ioremap(host->mapbase, SZ_4K);
1978 host->power_mode = -1; 1975 host->power_mode = MMC_POWER_OFF;
1979 1976
1980 platform_set_drvdata(pdev, host); 1977 platform_set_drvdata(pdev, host);
1981 INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect); 1978 INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect);