Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d51865bf authored by Sahitya Tummala's avatar Sahitya Tummala Committed by Xiaonian Wang
Browse files

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: default avatarSahitya Tummala <stummala@codeaurora.org>
Change-Id: I52f4d854388a608c6a09e55a693e3b36bd801fd8
parent ebbb9006
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2433,7 +2433,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)
@@ -2441,7 +2441,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;
}