From: lintao Date: Sun, 4 May 2014 07:01:43 +0000 (+0800) Subject: mmc: core: fix unbalanced pm_runtime_enable/disable X-Git-Tag: firefly_0821_release~5385 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ae0ea28b228d617b32d56f1c7a5ea3dc39bc82ca;p=firefly-linux-kernel-4.4.55.git mmc: core: fix unbalanced pm_runtime_enable/disable --- diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 664a19822913..0669ed0d73b4 100755 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -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); diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 1cccea4eca44..b020071a07c5 100755 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -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; } /*