mmc: sdhci: assigned to current clock value for host->clock
PATCH 1/1 mmc: sdhci: assigned to current clock value for host->clock
There is no place where host->clock is assgined to any value. If real clock is changed to mmc->clock, host->clock can be assigned to mmc->clock. If card request to same clock value, it doesn't need to call sdhci_set_clock() function.
--- drivers/mmc/sdhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/sdhci.c +4 -2
@@ -380,8 +380,10 @@ static void sdhci_set_ios(struct mmc *mmc)if (host->set_control_reg) host->set_control_reg (host); -if (mmc->clock != host->clock) -sdhci_set_clock (mmc, mmc->clock); +if (mmc->clock != host->clock) { +if (!sdhci_set_clock (mmc, mmc->clock)) + host->clock = mmc->clock; + }/* Set bus width */ ctrl =sdhci_readb (host,SDHCI_HOST_CONTROL );
Signature · 1 line
1.9.1
PATCH 1/1 mmc: sdhci: assigned to current clock value for host->clock
Hi!
Quoted 15 lines · Jaehoon Chung
There is no place where
host->clockis assgined to any value. If real clock is changed tommc->clock,host->clockcan be assigned tommc->clock. If card request to same clock value, it doesn't need to callsdhci_set_clock()function.Signed-off-by Jaehoon Chung <[email protected]>--- drivers/mmc/sdhci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/mmc/sdhci.c +0
-0
drivers/mmc/sdhci.c static void sdhci_set_ios(struct mmc *mmc) · line 385
Quoted 8 lines
drivers/mmc/sdhci.c +3
-2@@ -380,8 +380,10 @@ static void sdhci_set_ios(struct mmc *mmc)if (host->set_control_reg) host->set_control_reg (host); -if (mmc->clock != host->clock) -sdhci_set_clock (mmc, mmc->clock); +if (mmc->clock != host->clock) { +if (!sdhci_set_clock (mmc, mmc->clock)) + host->clock = mmc->clock;
I think it's better to move into sdhci_set_clock function.
drivers/mmc/sdhci.c static void sdhci_set_ios(struct mmc *mmc) · line 389
Quoted 5 lines
drivers/mmc/sdhci.c +1
-0+ }/* Set bus width */ ctrl =sdhci_readb (host,SDHCI_HOST_CONTROL );
Thanks,
Minkyu Kang.