diff options
| author | Seungwon Jeon <[email protected]> | 2014-12-22 17:42:03 +0530 |
|---|---|---|
| committer | Ulf Hansson <[email protected]> | 2015-01-19 09:56:11 +0100 |
| 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 <[email protected]>
Acked-by: Jaehoon Chung <[email protected]>
Signed-off-by: Alim Akhtar <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
| -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) 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 */ |