Commit 85e727ed authored by Jaehoon Chung's avatar Jaehoon Chung Committed by Chris Ball

mmc: core: return an error on suspend if mmc_deselect_cards fails

When mmc_host is not spi mode, mmc/sd is doing mmc_deselect_cards().
mmc_deselect_cards could be returned error.
If returned error, we can know something wrong when enter suspend.
Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Acked-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent ebbe6f88
...@@ -1326,7 +1326,7 @@ static int mmc_suspend(struct mmc_host *host) ...@@ -1326,7 +1326,7 @@ static int mmc_suspend(struct mmc_host *host)
if (!err) if (!err)
mmc_card_set_sleep(host->card); mmc_card_set_sleep(host->card);
} else if (!mmc_host_is_spi(host)) } else if (!mmc_host_is_spi(host))
mmc_deselect_cards(host); err = mmc_deselect_cards(host);
host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200); host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200);
mmc_release_host(host); mmc_release_host(host);
......
...@@ -1075,16 +1075,18 @@ static void mmc_sd_detect(struct mmc_host *host) ...@@ -1075,16 +1075,18 @@ static void mmc_sd_detect(struct mmc_host *host)
*/ */
static int mmc_sd_suspend(struct mmc_host *host) static int mmc_sd_suspend(struct mmc_host *host)
{ {
int err = 0;
BUG_ON(!host); BUG_ON(!host);
BUG_ON(!host->card); BUG_ON(!host->card);
mmc_claim_host(host); mmc_claim_host(host);
if (!mmc_host_is_spi(host)) if (!mmc_host_is_spi(host))
mmc_deselect_cards(host); err = mmc_deselect_cards(host);
host->card->state &= ~MMC_STATE_HIGHSPEED; host->card->state &= ~MMC_STATE_HIGHSPEED;
mmc_release_host(host); mmc_release_host(host);
return 0; return err;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment