From 1fa0b8ce81f9cdc0bedda8dcde9967f6dcd85f9c Mon Sep 17 00:00:00 2001 From: Sahitya Tummala Date: Wed, 18 Nov 2015 10:37:56 +0530 Subject: [PATCH] mmc: core: Make sure host is active before sending pon command Add mmc_get_card() to make sure host is resumed before sending pon command. Also, add mmc_put_card() after completing pon command so that it can release the host and also vote for runtime suspend. Signed-off-by: Sahitya Tummala Change-Id: I52f4d854388a608c6a09e55a693e3b36bd801fd8 --- drivers/mmc/core/mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 2f113b52e35e..fda54ff43720 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -2312,7 +2312,7 @@ int mmc_send_pon(struct mmc_card *card) if (!mmc_can_poweroff_notify(card)) goto out; - mmc_claim_host(host); + mmc_get_card(card); if (card->pon_type & MMC_LONG_PON) err = mmc_poweroff_notify(host->card, EXT_CSD_POWER_OFF_LONG); else if (card->pon_type & MMC_SHRT_PON) @@ -2320,7 +2320,7 @@ int mmc_send_pon(struct mmc_card *card) if (err) pr_warn("%s: error %d sending PON type %u", mmc_hostname(host), err, card->pon_type); - mmc_release_host(host); + mmc_put_card(card); out: return err; }