All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Yuvaraj Kumar C D <yuvaraj.cd@gmail.com>
Cc: linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	cjb@laptop.org, tgih.jun@samsung.com, alim.akhtar@samsung.com,
	ks.giri@samsung.com, t.figa@samsung.com,
	Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
Subject: Re: [RFC V2 1/4] mmc: dw_mmc: exynos: move the exynos private init
Date: Fri, 23 Aug 2013 22:44:28 +0900	[thread overview]
Message-ID: <5217673C.1040305@samsung.com> (raw)
In-Reply-To: <1377256509-18922-2-git-send-email-yuvaraj.cd@samsung.com>

Hi Yuvaraj,

On 08/23/2013 08:15 PM, Yuvaraj Kumar C D wrote:
> Currently platform specific private data initialisation is done by
> dw_mci_exynos_priv_init and dw_mci_exynos_parse_dt.As we already have
> separate platform specific device tree parser dw_mci_exynos_parse_dt,
> move the dw_mci_exynos_priv_init code to dw_mci_exynos_parse_dt.
> We can use the dw_mci_exynos_priv_init to do some actual platform
> specific initialisation of SMU and etc.
> 
> changes since V1: none
> 
> Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
> ---
>  drivers/mmc/host/dw_mmc-exynos.c |   31 +++++++++++++++----------------
>  1 file changed, 15 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
> index 9990f98..19c845b 100644
> --- a/drivers/mmc/host/dw_mmc-exynos.c
> +++ b/drivers/mmc/host/dw_mmc-exynos.c
> @@ -72,22 +72,8 @@ static struct dw_mci_exynos_compatible {
>  
>  static int dw_mci_exynos_priv_init(struct dw_mci *host)
>  {
> -	struct dw_mci_exynos_priv_data *priv;
> -	int idx;
> -
> -	priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL);
> -	if (!priv) {
> -		dev_err(host->dev, "mem alloc failed for private data\n");
> -		return -ENOMEM;
> -	}
> -
> -	for (idx = 0; idx < ARRAY_SIZE(exynos_compat); idx++) {
> -		if (of_device_is_compatible(host->dev->of_node,
> -					exynos_compat[idx].compatible))
> -			priv->ctrl_type = exynos_compat[idx].ctrl_type;
> -	}
> +	struct dw_mci_exynos_priv_data *priv = host->priv;
>  
> -	host->priv = priv;
>  	return 0;
>  }
>  
> @@ -177,12 +163,24 @@ static void dw_mci_exynos_set_ios(struct dw_mci *host, struct mmc_ios *ios)
>  
>  static int dw_mci_exynos_parse_dt(struct dw_mci *host)
>  {
> -	struct dw_mci_exynos_priv_data *priv = host->priv;
> +	struct dw_mci_exynos_priv_data *priv;
>  	struct device_node *np = host->dev->of_node;
>  	u32 timing[2];
>  	u32 div = 0;
> +	int idx;
>  	int ret;
>  
> +	priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL);
> +	if (!priv) {
> +		dev_err(host->dev, "mem alloc failed for private data\n");
> +		return -ENOMEM;
> +	}
> +
> +	for (idx = 0; idx < ARRAY_SIZE(exynos_compat); idx++) {
> +		if (of_device_is_compatible(np, exynos_compat[idx].compatible))
> +			priv->ctrl_type = exynos_compat[idx].ctrl_type;
> +	}
> +
>  	of_property_read_u32(np, "samsung,dw-mshc-ciu-div", &div);
>  	priv->ciu_div = div;
>  
> @@ -199,6 +197,7 @@ static int dw_mci_exynos_parse_dt(struct dw_mci *host)
>  		return ret;
>  
>  	priv->ddr_timing = SDMMC_CLKSEL_TIMING(timing[0], timing[1], div);
> +	host->priv = priv;

I'm not sure whether my thinking is right or not.
if host->pdata is present, then dw_mci_parse_dt() didn't called at dw_mci_probe.
then how host->priv set to priv?

Best Regards,
Jaehoon Chung

>  	return 0;
>  }
>  
> 


  reply	other threads:[~2013-08-23 13:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 11:15 [RFC V2 0/4] dw_mmc platform specific private data init Yuvaraj Kumar C D
2013-08-23 11:15 ` [RFC V2 1/4] mmc: dw_mmc: exynos: move the exynos private init Yuvaraj Kumar C D
2013-08-23 13:44   ` Jaehoon Chung [this message]
2013-08-26  9:20     ` Yuvaraj Kumar
2013-08-27  2:34       ` Jaehoon Chung
2013-08-27  6:03         ` Yuvaraj Kumar
2013-08-23 11:15 ` [RFC V2 2/4] mmc: dw_mmc: socfpga: move socfpga " Yuvaraj Kumar C D
2013-08-23 11:15 ` [RFC V2 3/4] mmc: dw_mmc: move the platform specific init call Yuvaraj Kumar C D
2013-08-23 13:45   ` Jaehoon Chung
2013-08-23 11:15 ` [RFC V2 4/4] mmc: dw_mmc: exynos: add a quirk for SMU Yuvaraj Kumar C D
2013-08-23 12:55   ` Jaehoon Chung
2013-08-23 13:14     ` Yuvaraj Kumar
2013-08-28  5:46 ` [RFC V2 0/4] dw_mmc platform specific private data init Alim Akhtar

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=5217673C.1040305@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=cjb@laptop.org \
    --cc=ks.giri@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=t.figa@samsung.com \
    --cc=tgih.jun@samsung.com \
    --cc=yuvaraj.cd@gmail.com \
    --cc=yuvaraj.cd@samsung.com \
    /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.