aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorLi Fei <fei.li@intel.com>2013-04-07 21:36:39 -0400
committerChris Ball <cjb@laptop.org>2013-04-12 14:15:04 -0400
commit3bffb800b91bb128b61d83deb01ce63c455d108f (patch)
treec43e1e0a36a6227fcf2be401aab951eec390e31e /drivers/mmc/core
parentabd4190f0c820b7f118450b52bb95c0be3a441bd (diff)
mmc: core: call pm_runtime_put_noidle in pm_runtime_get_sync failed case
Even in failed case of pm_runtime_get_sync, the usage_count is incremented. In order to keep the usage_count with correct value and runtime power management to behave correctly, call pm_runtime_put_noidle in such case. Signed-off-by: Liu Chuansheng <chuansheng.liu@intel.com> Signed-off-by: Li Fei <fei.li@intel.com> Acked-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/sdio.c4
-rw-r--r--drivers/mmc/core/sdio_bus.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index aa0719a4dfd1..6889a821c1da 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -861,8 +861,10 @@ static void mmc_sdio_detect(struct mmc_host *host)
861 /* Make sure card is powered before detecting it */ 861 /* Make sure card is powered before detecting it */
862 if (host->caps & MMC_CAP_POWER_OFF_CARD) { 862 if (host->caps & MMC_CAP_POWER_OFF_CARD) {
863 err = pm_runtime_get_sync(&host->card->dev); 863 err = pm_runtime_get_sync(&host->card->dev);
864 if (err < 0) 864 if (err < 0) {
865 pm_runtime_put_noidle(&host->card->dev);
865 goto out; 866 goto out;
867 }
866 } 868 }
867 869
868 mmc_claim_host(host); 870 mmc_claim_host(host);
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 8d6bb1821834..546c67c2bbbf 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -138,7 +138,7 @@ static int sdio_bus_probe(struct device *dev)
138 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) { 138 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) {
139 ret = pm_runtime_get_sync(dev); 139 ret = pm_runtime_get_sync(dev);
140 if (ret < 0) 140 if (ret < 0)
141 goto out; 141 goto disable_runtimepm;
142 } 142 }
143 143
144 /* Set the default block size so the driver is sure it's something 144 /* Set the default block size so the driver is sure it's something
@@ -158,7 +158,6 @@ static int sdio_bus_probe(struct device *dev)
158disable_runtimepm: 158disable_runtimepm:
159 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) 159 if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
160 pm_runtime_put_noidle(dev); 160 pm_runtime_put_noidle(dev);
161out:
162 return ret; 161 return ret;
163} 162}
164 163