mmc: core: fix unbalanced pm_runtime_enable/disable

This commit is contained in:
lintao
2014-05-04 15:01:43 +08:00
parent 77356b196e
commit ae0ea28b22
2 changed files with 10 additions and 2 deletions

View File

@@ -127,7 +127,7 @@ static void mmc_bus_shutdown(struct device *dev)
struct mmc_driver *drv = to_mmc_driver(dev->driver);
struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_host *host = card->host;
int ret;
int ret = 0;
if (dev->driver && drv->shutdown)
drv->shutdown(card);

View File

@@ -1479,7 +1479,15 @@ out:
*/
static int mmc_suspend(struct mmc_host *host)
{
return _mmc_suspend(host, true);
int err;
err = _mmc_suspend(host, true);
if (!err) {
pm_runtime_disable(&host->card->dev);
pm_runtime_set_suspended(&host->card->dev);
}
return err;
}
/*