mmc: core: fix wrong return value when suspend
PATCH 1/1 mmc: core: fix wrong return value when suspend
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 Jaehoon Chung <[email protected]>
Signed-off-by Kyungmin Park <[email protected]>
--- drivers/mmc/core/mmc.c | 2 +- drivers/mmc/core/sd.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/mmc/core/mmc.c +1 -1
@@ -1326,7 +1326,7 @@ static int mmc_suspend(struct mmc_host *host)if (!err)mmc_card_set_sleep (host->card); }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 );mmc_release_host (host);
drivers/mmc/core/sd.c +4 -2
@@ -1075,16 +1075,18 @@ static void mmc_sd_detect(struct mmc_host *host)*/ static int mmc_sd_suspend (struct mmc_host *host) { +int err =0 ; +BUG_ON (!host);BUG_ON (!host->card);mmc_claim_host (host);if (!mmc_host_is_spi (host)) -mmc_deselect_cards (host); + err =mmc_deselect_cards (host); host->card->state &= ~MMC_STATE_HIGHSPEED ;mmc_release_host (host); -return 0 ; +return err; }/*
Hi Jaehoon,
This make sense to me!
Acked-by Ulf Hansson <[email protected]>
Kind regards
Ulf Hansson
Quoted 6 lines · Jaehoon Chung
When
mmc_hostis not spi mode, mmc/sd is doingmmc_deselect_cards().mmc_deselect_cardscould be returned error.
If returned error, we can know something wrong when enter suspend.Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]>
Hi,
Quoted 11 lines · Ulf Hansson
Quoted 6 lines · Jaehoon Chung
When
mmc_hostis not spi mode, mmc/sd is doingmmc_deselect_cards().mmc_deselect_cardscould be returned error.
If returned error, we can know something wrong when enter suspend.Signed-off-by Jaehoon Chung <[email protected]>Signed-off-by Kyungmin Park <[email protected]>This make sense to me!
Acked-by Ulf Hansson <[email protected]>
Thanks, pushed to mmc-next for 3.5.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child