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

Commit 55f24176 authored by Sarthak Garg's avatar Sarthak Garg Committed by Gerrit - the friendly Code Review server
Browse files

mmc: core: Fix mmc shutdown issue



In a specific case for poweroff notify host resumes the card in
order to shut it down properly. During resume if the mmc device is
not suspended it returns with a default error -22 though there is
no error. Set that default error value as zero and make changes
to be consistent with the code flow.

Change-Id: Iff46bc8c517009b9d4348f8979f6c7e31639de84
Signed-off-by: default avatarSarthak Garg <sartgarg@codeaurora.org>
parent 38ae0c3a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2702,14 +2702,14 @@ static int mmc_suspend(struct mmc_host *host)
 */
static int _mmc_resume(struct mmc_host *host)
{
	int err = -EINVAL;
	int err = 0;
	int retries = 3;

	mmc_claim_host(host);

	if (!mmc_card_suspended(host->card)) {
		mmc_release_host(host);
		goto out;
		return err;
	}

	mmc_log_string(host, "Enter\n");
@@ -2724,7 +2724,7 @@ static int _mmc_resume(struct mmc_host *host)
						mmc_hostname(host), __func__,
						err);
		}
		if (err) {
		if (!mmc_can_sleepawake(host) || err) {
			err = mmc_init_card(host, host->card->ocr, host->card);
			if (err) {
				pr_err("%s: MMC card re-init failed rc = %d (retries = %d)\n",
@@ -2749,7 +2749,7 @@ static int _mmc_resume(struct mmc_host *host)
	if (err)
		pr_err("%s: %s: fail to resume clock scaling (%d)\n",
			mmc_hostname(host), __func__, err);
out:

	return err;
}