aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sd.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2014-12-05 12:40:59 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2015-01-19 03:56:30 -0500
commit63e415c64003fd62a302a1dc19f082e2c6f1b7cc (patch)
tree87a6a228a7f2b2fc19c9e3f67b1339181b930f05 /drivers/mmc/core/sd.c
parentfdb9de129e1d68e1b804bc9c8b3027bea9b88bc8 (diff)
mmc: core: Simplify by adding mmc_execute_tuning()
For each MMC, SD and SDIO there is code that holds the clock, calls ops->execute_tuning, and releases the clock. Simplify the code a bit by providing a separate function to do that. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/sd.c')
-rw-r--r--drivers/mmc/core/sd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 36d5333838cb..ad4d43eae99d 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -660,15 +660,10 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
660 * SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and 660 * SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and
661 * SDR104 mode SD-cards. Note that tuning is mandatory for SDR104. 661 * SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
662 */ 662 */
663 if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning && 663 if (!mmc_host_is_spi(card->host) &&
664 (card->sd_bus_speed == UHS_SDR50_BUS_SPEED || 664 (card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
665 card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) { 665 card->sd_bus_speed == UHS_SDR104_BUS_SPEED))
666 mmc_host_clk_hold(card->host); 666 err = mmc_execute_tuning(card);
667 err = card->host->ops->execute_tuning(card->host,
668 MMC_SEND_TUNING_BLOCK);
669 mmc_host_clk_release(card->host);
670 }
671
672out: 667out:
673 kfree(status); 668 kfree(status);
674 669