Commit a2a1fed8 authored by Seungwon Jeon's avatar Seungwon Jeon Committed by Ulf Hansson

mmc: dw_mmc: exynos: don't use if clock isn't available

Add checking whether the clock is valid.
Signed-off-by: default avatarSeungwon Jeon <tgih.jun@samsung.com>
Acked-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 1a25b1b4
...@@ -127,9 +127,9 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host) ...@@ -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) static int dw_mci_exynos_setup_clock(struct dw_mci *host)
{ {
struct dw_mci_exynos_priv_data *priv = host->priv; 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; return 0;
} }
...@@ -232,8 +232,11 @@ static void dw_mci_exynos_set_ios(struct dw_mci *host, struct mmc_ios *ios) ...@@ -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); 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; return;
/* Guaranteed minimum frequency for cclkin */ /* Guaranteed minimum frequency for cclkin */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment