mmc: core: fix unbalanced pm_runtime_enable/disable
authorlintao <lintao@rock-chips.com>
Sun, 4 May 2014 07:01:43 +0000 (15:01 +0800)
committerlintao <lintao@rock-chips.com>
Sun, 4 May 2014 07:02:03 +0000 (15:02 +0800)
drivers/mmc/core/bus.c
drivers/mmc/core/mmc.c

index 664a198229134e8218653c4db7c4c07a77daddc9..0669ed0d73b425d25053a9f5cb8fbdaa4e548ed4 100755 (executable)
@@ -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);
index 1cccea4eca440a42e8c5b028c2174faefd16066e..b020071a07c5fbc29155b6aa9f71d4bdf99d6755 100755 (executable)
@@ -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;
 }
 
 /*