From: Seungwon Jeon <tgih.jun@samsung.com>
To: linux-samsung-soc@vger.kernel.org, linux-mmc@vger.kernel.org
Cc: 'Chris Ball' <chris@printf.net>,
'Kukjin Kim' <kgene.kim@samsung.com>,
'Jaehoon Chung' <jh80.chung@samsung.com>,
'Ulf Hansson' <ulf.hansson@linaro.org>,
'Alim Akhtar' <alim.akhtar@samsung.com>
Subject: [PATCH 2/7] mmc: dw_mmc: exynos: don't use if clock isn't available
Date: Fri, 21 Mar 2014 23:03:21 +0900 [thread overview]
Message-ID: <001c01cf450e$51ba0d40$f52e27c0$%jun@samsung.com> (raw)
Adds checking whether the clock is valid.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
drivers/mmc/host/dw_mmc-exynos.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index a67e784..89aa019 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -117,7 +117,12 @@ 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);
+ unsigned long rate;
+
+ if (IS_ERR(host->ciu_clk))
+ rate = host->bus_hz;
+ else
+ rate = clk_get_rate(host->ciu_clk);
host->bus_hz = rate / (priv->ciu_div + 1);
return 0;
@@ -196,8 +201,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 */
--
1.7.4.1
next reply other threads:[~2014-03-21 14:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 14:03 Seungwon Jeon [this message]
2014-03-24 4:19 ` [PATCH 2/7] mmc: dw_mmc: exynos: don't use if clock isn't available Jaehoon Chung
2014-03-24 6:39 ` Seungwon Jeon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001c01cf450e$51ba0d40$f52e27c0$%jun@samsung.com' \
--to=tgih.jun@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=chris@printf.net \
--cc=jh80.chung@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox