aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/core/sdio_bus.c
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2011-07-17 16:38:21 +0100
committerChris Ball <cjb@laptop.org>2011-07-21 10:35:09 -0400
commitecc024419a13da1e589aebc422d9d1e3c0124ba4 (patch)
tree7f46c0fd259b76ca2f13cb2cd8b2675326f1bab6 /drivers/mmc/core/sdio_bus.c
parentb0a68ec9444384269ec06b474c0a841ccd6fcdf9 (diff)
downloadlinux-stericsson-ecc024419a13da1e589aebc422d9d1e3c0124ba4.tar.gz
mmc: fix runtime PM with -ENOSYS suspend case
In the case where a driver returns -ENOSYS from its suspend handler to indicate that the device should be powered down over suspend, the remove routine of the driver was not being called, leading to lots of confusion during resume. The problem is that runtime PM is disabled during this process, and when we reach mmc_sdio_remove, calling the runtime PM functions here (validly) return errors, and this was causing us to skip the remove function. Fix this by ignoring the error value of pm_runtime_get_sync(), which can return valid errors. This also matches the behaviour of pci_device_remove(). Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/sdio_bus.c')
-rw-r--r--drivers/mmc/core/sdio_bus.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index d2565df8a7fb..e4e6822d09e3 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -167,11 +167,8 @@ static int sdio_bus_remove(struct device *dev)
int ret = 0;
/* Make sure card is powered before invoking ->remove() */
- if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) {
- ret = pm_runtime_get_sync(dev);
- if (ret < 0)
- goto out;
- }
+ if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
+ pm_runtime_get_sync(dev);
drv->remove(func);
@@ -191,7 +188,6 @@ static int sdio_bus_remove(struct device *dev)
if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
pm_runtime_put_sync(dev);
-out:
return ret;
}