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 <stummala@codeaurora.org>
Change-Id: I52f4d854388a608c6a09e55a693e3b36bd801fd8
This commit is contained in:
Sahitya Tummala 2015-11-18 10:37:56 +05:30 committed by Subhash Jadavani
parent 6c8e3e70c9
commit 1fa0b8ce81

View file

@ -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;
}