diff options
author | Seungwon Jeon <tgih.jun@samsung.com> | 2014-12-22 07:12:03 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-01-19 03:56:11 -0500 |
commit | a2a1fed8ea69ffae682eb606f1a722e7d034df8e (patch) | |
tree | 21c1e52953fd6bc30fdd417cbb548017c4882c3b | |
parent | 1a25b1b4199c477f1538f63c1da2b998323e274e (diff) |
mmc: dw_mmc: exynos: don't use if clock isn't available
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>
-rw-r--r-- | drivers/mmc/host/dw_mmc-exynos.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c index 509365cb22c6..556663fe9b47 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c | |||
@@ -127,9 +127,9 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host) | |||
127 | static int dw_mci_exynos_setup_clock(struct dw_mci *host) | 127 | static int dw_mci_exynos_setup_clock(struct dw_mci *host) |
128 | { | 128 | { |
129 | struct dw_mci_exynos_priv_data *priv = host->priv; | 129 | struct dw_mci_exynos_priv_data *priv = host->priv; |
130 | unsigned long rate = clk_get_rate(host->ciu_clk); | ||
131 | 130 | ||
132 | host->bus_hz = rate / (priv->ciu_div + 1); | 131 | host->bus_hz /= (priv->ciu_div + 1); |
132 | |||
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | 135 | ||
@@ -232,8 +232,11 @@ static void dw_mci_exynos_set_ios(struct dw_mci *host, struct mmc_ios *ios) | |||
232 | mci_writel(host, CLKSEL, priv->sdr_timing); | 232 | mci_writel(host, CLKSEL, priv->sdr_timing); |
233 | } | 233 | } |
234 | 234 | ||
235 | /* Don't care if wanted clock is zero */ | 235 | /* |
236 | if (!wanted) | 236 | * Don't care if wanted clock is zero or |
237 | * ciu clock is unavailable | ||
238 | */ | ||
239 | if (!wanted || IS_ERR(host->ciu_clk)) | ||
237 | return; | 240 | return; |
238 | 241 | ||
239 | /* Guaranteed minimum frequency for cclkin */ | 242 | /* Guaranteed minimum frequency for cclkin */ |