mmc: sdhci: assign to clk_mul when host version is upper than SD3.0
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 21 Oct 2016 11:52:35 +0000 (20:52 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 28 Oct 2016 02:02:16 +0000 (11:02 +0900)
To prevent the wrong value check the SD version.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/sdhci.c

index 10ff57ec8c7758f6a67eb30617becccecfc4a720..766e9eef84a964df4e4762be5b864dd2743dcabf 100644 (file)
@@ -608,9 +608,11 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
         * In case of Host Controller v3.00, find out whether clock
         * multiplier is supported.
         */
-       caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
-       host->clk_mul = (caps_1 & SDHCI_CLOCK_MUL_MASK) >>
-                       SDHCI_CLOCK_MUL_SHIFT;
+       if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
+               caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
+               host->clk_mul = (caps_1 & SDHCI_CLOCK_MUL_MASK) >>
+                               SDHCI_CLOCK_MUL_SHIFT;
+       }
 
        return 0;
 }