diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-04-25 13:58:45 +0200 |
---|---|---|
committer | Chris Ball <chris@printf.net> | 2014-05-22 13:26:31 +0200 |
commit | 373073efd06528867df963724a93f29c7d5534d0 (patch) | |
tree | 243ef5e56d8d686f824151bd4e8514a43b4d63e7 /drivers/mmc/host/sdhci.c | |
parent | mmc: sdhci: clean up sdhci_update_clock()/sdhci_set_clock() (diff) | |
download | linux-373073efd06528867df963724a93f29c7d5534d0.tar.xz linux-373073efd06528867df963724a93f29c7d5534d0.zip |
mmc: sdhci: move setting host->clock into sdhci_do_set_ios()
We don't need implementations to do this, since the only time it's
necessary is when we change the clock, and the only place that happens
is in sdhci_do_set_ios(). So, move it there, and remove it from the
iMX platform backend.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Markus Pargmann <mpa@pengutronix.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index e3a2ecc45752..68269bf38e0c 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1130,7 +1130,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); if (clock == 0) - goto out; + return; if (host->version >= SDHCI_SPEC_300) { if (sdhci_readw(host, SDHCI_HOST_CONTROL2) & @@ -1220,9 +1220,6 @@ clock_set: clk |= SDHCI_CLOCK_CARD_EN; sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); - -out: - host->clock = clock; } static int sdhci_set_power(struct sdhci_host *host, unsigned short power) @@ -1441,8 +1438,10 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) sdhci_enable_preset_value(host, false); - if (!ios->clock || ios->clock != host->clock) + if (!ios->clock || ios->clock != host->clock) { sdhci_set_clock(host, ios->clock); + host->clock = ios->clock; + } if (ios->power_mode == MMC_POWER_OFF) vdd_bit = sdhci_set_power(host, -1); |