All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Seungwon Jeon <tgih.jun@samsung.com>,
	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: Re: [PATCH 2/7] mmc: dw_mmc: exynos: don't use if clock isn't available
Date: Mon, 24 Mar 2014 13:19:40 +0900	[thread overview]
Message-ID: <532FB25C.6000700@samsung.com> (raw)
In-Reply-To: <001c01cf450e$51ba0d40$f52e27c0$%jun@samsung.com>

Hi, Seungwon.

On 03/21/2014 11:03 PM, Seungwon Jeon wrote:
> 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);
how about this?
host->bus_hz /= (priv->ciu_div + 1);

host->bus_hz is already set to "host->bus_hz" or "clk_get_rate()" into dw_mmc.c.

Best Regards,
Jaehoon Chung
>  	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 */
> 

  reply	other threads:[~2014-03-24  4:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 14:03 [PATCH 2/7] mmc: dw_mmc: exynos: don't use if clock isn't available Seungwon Jeon
2014-03-24  4:19 ` Jaehoon Chung [this message]
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=532FB25C.6000700@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=chris@printf.net \
    --cc=kgene.kim@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=tgih.jun@samsung.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.