diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2018-02-26 17:24:47 +0800 |
---|---|---|
committer | Shawn Lin <shawn.lin@rock-chips.com> | 2018-02-27 10:16:19 +0800 |
commit | 2ff9b261ab9f524f8c8c546f292b36653baaf389 (patch) | |
tree | e043205b6ef46098c17622158c14edfd134ee801 /drivers/mmc | |
parent | 252aa7dac9407920edaac2d389dab6154036506f (diff) |
BACKPORT: UPSTREAM: mmc: sdio: Factor out retry init card helper function
Add new helper function, mmc_sdio_resend_if_cond, to be
reused when trying to retry the init sequence.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Change-Id: I3eb7ffdc18ddb49f34e39198ac4a65cdb8cad586
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
(cherry picked from 0eb51a58ad823b2081c69ec1cf165833dd11c450)
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/sdio.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 87684504e9c2..3e1881ce08c3 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -548,6 +548,15 @@ out: return err; } +static void mmc_sdio_resend_if_cond(struct mmc_host *host, + struct mmc_card *card) +{ + sdio_reset(host); + mmc_go_idle(host); + mmc_send_if_cond(host, host->ocr_avail); + mmc_remove_card(card); +} + /* * Handle the detection and initialisation of a card. * @@ -638,10 +647,7 @@ try_again: err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, ocr_card); if (err == -EAGAIN) { - sdio_reset(host); - mmc_go_idle(host); - mmc_send_if_cond(host, host->ocr_avail); - mmc_remove_card(card); + mmc_sdio_resend_if_cond(host, card); retries--; goto try_again; } else if (err) { |