Skip to contentSkip to conversation

mmc: core: fix wrong return value when suspend

PATCH In review Jaehoon Chung 3 participants 3 messages May 31, 2012 – Jun 6, 2012 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

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.

---
 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
index 2d4a4b7..258b203 100644
@@ -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
index c272c686..b2b43f6 100644
@@ -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;
 }
 
 /*
#2 lore raw

Hi,

Quoted 11 lines · Ulf Hansson
Quoted 6 lines · Jaehoon Chung

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.

This make sense to me!

Thanks, pushed to mmc-next for 3.5.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child