diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2017-01-09 03:56:19 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-02-13 07:20:12 -0500 |
commit | 0eb51a58ad823b2081c69ec1cf165833dd11c450 (patch) | |
tree | 1abb0dd9d68033030f2d3a2c784fcac3ecc17f18 /drivers/mmc/core/sdio.c | |
parent | 63928d4789ebb3f7d35d9261089b3bcc98ae0632 (diff) |
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: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/sdio.c')
-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 ecbc52981ba5..f417adc9feb1 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
@@ -541,6 +541,15 @@ out: | |||
541 | return err; | 541 | return err; |
542 | } | 542 | } |
543 | 543 | ||
544 | static void mmc_sdio_resend_if_cond(struct mmc_host *host, | ||
545 | struct mmc_card *card) | ||
546 | { | ||
547 | sdio_reset(host); | ||
548 | mmc_go_idle(host); | ||
549 | mmc_send_if_cond(host, host->ocr_avail); | ||
550 | mmc_remove_card(card); | ||
551 | } | ||
552 | |||
544 | /* | 553 | /* |
545 | * Handle the detection and initialisation of a card. | 554 | * Handle the detection and initialisation of a card. |
546 | * | 555 | * |
@@ -630,10 +639,7 @@ try_again: | |||
630 | err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, | 639 | err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, |
631 | ocr_card); | 640 | ocr_card); |
632 | if (err == -EAGAIN) { | 641 | if (err == -EAGAIN) { |
633 | sdio_reset(host); | 642 | mmc_sdio_resend_if_cond(host, card); |
634 | mmc_go_idle(host); | ||
635 | mmc_send_if_cond(host, host->ocr_avail); | ||
636 | mmc_remove_card(card); | ||
637 | retries--; | 643 | retries--; |
638 | goto try_again; | 644 | goto try_again; |
639 | } else if (err) { | 645 | } else if (err) { |