mmc: dw_mmc: exynos: don't use if clock isn't available
authorSeungwon Jeon <tgih.jun@samsung.com>
Mon, 22 Dec 2014 12:12:03 +0000 (17:42 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 19 Jan 2015 08:56:11 +0000 (09:56 +0100)
Add checking whether the clock is valid.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc-exynos.c

index 509365cb22c6ad0fd0150a87aa9d5edb0d0161e1..556663fe9b472dda0f0725d23ad78590118bd883 100644 (file)
@@ -127,9 +127,9 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host)
 static int dw_mci_exynos_setup_clock(struct dw_mci *host)
 {
        struct dw_mci_exynos_priv_data *priv = host->priv;
-       unsigned long rate = clk_get_rate(host->ciu_clk);
 
-       host->bus_hz = rate / (priv->ciu_div + 1);
+       host->bus_hz /= (priv->ciu_div + 1);
+
        return 0;
 }
 
@@ -232,8 +232,11 @@ static void dw_mci_exynos_set_ios(struct dw_mci *host, struct mmc_ios *ios)
                        mci_writel(host, CLKSEL, priv->sdr_timing);
        }
 
-       /* Don't care if wanted clock is zero */
-       if (!wanted)
+       /*
+        * Don't care if wanted clock is zero or
+        * ciu clock is unavailable
+        */
+       if (!wanted || IS_ERR(host->ciu_clk))
                return;
 
        /* Guaranteed minimum frequency for cclkin */
This page took 0.025331 seconds and 5 git commands to generate.