aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio.c
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2017-01-09 16:56:19 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2017-02-13 13:20:12 +0100
commit0eb51a58ad823b2081c69ec1cf165833dd11c450 (patch)
tree1abb0dd9d68033030f2d3a2c784fcac3ecc17f18 /drivers/mmc/core/sdio.c
parentmmc: core: Use kmalloc_array() in mmc_alloc_sg() (diff)
downloadlinux-dev-0eb51a58ad823b2081c69ec1cf165833dd11c450.tar.xz
linux-dev-0eb51a58ad823b2081c69ec1cf165833dd11c450.zip
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.c14
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:
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.
*
@@ -630,10 +639,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) {