summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/sd.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2014-12-05 20:40:59 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2015-01-19 11:56:30 +0300
commit63e415c64003fd62a302a1dc19f082e2c6f1b7cc (patch)
tree87a6a228a7f2b2fc19c9e3f67b1339181b930f05 /drivers/mmc/core/sd.c
parentfdb9de129e1d68e1b804bc9c8b3027bea9b88bc8 (diff)
downloadlinux-63e415c64003fd62a302a1dc19f082e2c6f1b7cc.tar.xz
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)
* SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
*/
- if (!mmc_host_is_spi(card->host) && card->host->ops->execute_tuning &&
- (card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
- card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) {
- mmc_host_clk_hold(card->host);
- err = card->host->ops->execute_tuning(card->host,
- MMC_SEND_TUNING_BLOCK);
- mmc_host_clk_release(card->host);
- }
-
+ if (!mmc_host_is_spi(card->host) &&
+ (card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
+ card->sd_bus_speed == UHS_SDR104_BUS_SPEED))
+ err = mmc_execute_tuning(card);
out:
kfree(status);