diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2018-02-26 20:26:34 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2018-03-15 04:32:30 -0400 |
commit | 1e178270dfcf2b576b0060b382836219dcda83b5 (patch) | |
tree | 319b1f555e42f39567428d72b7130633b94cb273 | |
parent | d6743a8a1ae38269a41094ad14d7ef86199f661d (diff) |
mmc: sdio: Check the return value of sdio_enable_4bit_bus
Since we could move card->host->caps & MMC_CAP_4_BIT_DATA
ahead of mmc_sdio_init_uhs_card, in mmc_host_uhs(). So there
we could save this bit to check that. Also, if the process of
sdio_enable_4bit_bus goes wrong, we should bails out early.
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/core/sdio.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index cc43687ca241..c599a628a387 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -518,11 +518,10 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card) | |||
518 | if (!card->scr.sda_spec3) | 518 | if (!card->scr.sda_spec3) |
519 | return 0; | 519 | return 0; |
520 | 520 | ||
521 | /* | 521 | /* Switch to wider bus */ |
522 | * Switch to wider bus (if supported). | 522 | err = sdio_enable_4bit_bus(card); |
523 | */ | 523 | if (err) |
524 | if (card->host->caps & MMC_CAP_4_BIT_DATA) | 524 | goto out; |
525 | err = sdio_enable_4bit_bus(card); | ||
526 | 525 | ||
527 | /* Set the driver strength for the card */ | 526 | /* Set the driver strength for the card */ |
528 | sdio_select_driver_type(card); | 527 | sdio_select_driver_type(card); |