diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2012-05-31 07:31:47 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-06-06 09:49:47 -0400 |
commit | 85e727edb963459d13cdd9ce84c335d251a005a7 (patch) | |
tree | cfa8fe464a986f5e490ce4dd3537a3b5f3629a5d /drivers/mmc | |
parent | ebbe6f889f36d35f4d1757ba2ecc0af6150bf12b (diff) |
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: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/mmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/core/sd.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 2d4a4b74675..258b203397a 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -1326,7 +1326,7 @@ static int mmc_suspend(struct mmc_host *host) | |||
1326 | if (!err) | 1326 | if (!err) |
1327 | mmc_card_set_sleep(host->card); | 1327 | mmc_card_set_sleep(host->card); |
1328 | } else if (!mmc_host_is_spi(host)) | 1328 | } else if (!mmc_host_is_spi(host)) |
1329 | mmc_deselect_cards(host); | 1329 | err = mmc_deselect_cards(host); |
1330 | host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200); | 1330 | host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200); |
1331 | mmc_release_host(host); | 1331 | mmc_release_host(host); |
1332 | 1332 | ||
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index c272c6868ec..b2b43f624b9 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c | |||
@@ -1075,16 +1075,18 @@ static void mmc_sd_detect(struct mmc_host *host) | |||
1075 | */ | 1075 | */ |
1076 | static int mmc_sd_suspend(struct mmc_host *host) | 1076 | static int mmc_sd_suspend(struct mmc_host *host) |
1077 | { | 1077 | { |
1078 | int err = 0; | ||
1079 | |||
1078 | BUG_ON(!host); | 1080 | BUG_ON(!host); |
1079 | BUG_ON(!host->card); | 1081 | BUG_ON(!host->card); |
1080 | 1082 | ||
1081 | mmc_claim_host(host); | 1083 | mmc_claim_host(host); |
1082 | if (!mmc_host_is_spi(host)) | 1084 | if (!mmc_host_is_spi(host)) |
1083 | mmc_deselect_cards(host); | 1085 | err = mmc_deselect_cards(host); |
1084 | host->card->state &= ~MMC_STATE_HIGHSPEED; | 1086 | host->card->state &= ~MMC_STATE_HIGHSPEED; |
1085 | mmc_release_host(host); | 1087 | mmc_release_host(host); |
1086 | 1088 | ||
1087 | return 0; | 1089 | return err; |
1088 | } | 1090 | } |
1089 | 1091 | ||
1090 | /* | 1092 | /* |