From: Seungwon Jeon <tgih.jun@samsung.com>
To: 'Yuvaraj Kumar C D' <yuvaraj.cd@gmail.com>,
linux-mmc@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
cjb@laptop.org, jh80.chung@samsung.com
Cc: ks.giri@samsung.com, t.figa@samsung.com, alim.akhtar@samsung.com,
'Yuvaraj Kumar C D' <yuvaraj.cd@samsung.com>,
'Dinh Nguyen' <dinguyen@altera.com>
Subject: RE: [RFC V3 2/4] mmc: dw_mmc: socfpga: move socfpga private init
Date: Thu, 29 Aug 2013 20:59:48 +0900 [thread overview]
Message-ID: <001601cea4af$42e662f0$c8b328d0$%jun@samsung.com> (raw)
In-Reply-To: <1377691731-7226-3-git-send-email-yuvaraj.cd@samsung.com>
On Wed, August 28, 2013, Yuvaraj Kumar C D wrote:
> Currently platform specific private data initialisation is done by
> dw_mci_socfpga_priv_init and dw_mci_socfpga_parse_dt.As we already have
> separate platform specific device tree parser dw_mci_socfpga_parse_dt,
> move the dw_mci_socfpga_priv_init code to dw_mci_socfpga_parse_dt.
> We can use the dw_mci_socfpga_priv_init to do some actual platform
> specific initialisation.
>
> This patch is compile tested only.
CC'ed Dinh Nguyen
Thanks,
Seungwon Jeon
>
> changes since V2: none
>
> Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
> ---
> drivers/mmc/host/dw_mmc-socfpga.c | 29 ++++++++++++++---------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc-socfpga.c b/drivers/mmc/host/dw_mmc-socfpga.c
> index 14b5961..953f260 100644
> --- a/drivers/mmc/host/dw_mmc-socfpga.c
> +++ b/drivers/mmc/host/dw_mmc-socfpga.c
> @@ -38,20 +38,6 @@ struct dw_mci_socfpga_priv_data {
>
> static int dw_mci_socfpga_priv_init(struct dw_mci *host)
> {
> - struct dw_mci_socfpga_priv_data *priv;
> -
> - priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL);
> - if (!priv) {
> - dev_err(host->dev, "mem alloc failed for private data\n");
> - return -ENOMEM;
> - }
> -
> - priv->sysreg = syscon_regmap_lookup_by_compatible("altr,sys-mgr");
> - if (IS_ERR(priv->sysreg)) {
> - dev_err(host->dev, "regmap for altr,sys-mgr lookup failed.\n");
> - return PTR_ERR(priv->sysreg);
> - }
> - host->priv = priv;
>
> return 0;
> }
> @@ -79,12 +65,24 @@ static void dw_mci_socfpga_prepare_command(struct dw_mci *host, u32 *cmdr)
>
> static int dw_mci_socfpga_parse_dt(struct dw_mci *host)
> {
> - struct dw_mci_socfpga_priv_data *priv = host->priv;
> + struct dw_mci_socfpga_priv_data *priv;
> struct device_node *np = host->dev->of_node;
> u32 timing[2];
> u32 div = 0;
> 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;
> + }
> +
> + priv->sysreg = syscon_regmap_lookup_by_compatible("altr,sys-mgr");
> + if (IS_ERR(priv->sysreg)) {
> + dev_err(host->dev, "regmap for altr,sys-mgr lookup failed.\n");
> + return PTR_ERR(priv->sysreg);
> + }
> +
> ret = of_property_read_u32(np, "altr,dw-mshc-ciu-div", &div);
> if (ret)
> dev_info(host->dev, "No dw-mshc-ciu-div specified, assuming 1");
> @@ -96,6 +94,7 @@ static int dw_mci_socfpga_parse_dt(struct dw_mci *host)
> return ret;
>
> priv->hs_timing = SYSMGR_SDMMC_CTRL_SET(timing[0], timing[1]);
> + host->priv = priv;
> return 0;
> }
>
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-08-29 11:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-28 12:08 [RFC V3 0/4] dw_mmc platform specific private data and SMU init Yuvaraj Kumar C D
2013-08-28 12:08 ` [RFC V3 1/4] mmc: dw_mmc: exynos: move the exynos private init Yuvaraj Kumar C D
2013-08-28 12:08 ` [RFC V3 2/4] mmc: dw_mmc: socfpga: move socfpga " Yuvaraj Kumar C D
2013-08-29 11:59 ` Seungwon Jeon [this message]
2013-09-04 19:31 ` Dinh Nguyen
2013-09-05 5:41 ` Yuvaraj Kumar
2013-08-28 12:08 ` [RFC V3 3/4] mmc: dw_mmc: move the platform specific init call Yuvaraj Kumar C D
2013-08-28 12:08 ` [RFC V3 4/4] mmc: dw_mmc: exynos: configure SMU in exynos5420 Yuvaraj Kumar C D
2013-08-29 8:23 ` Seungwon Jeon
2013-08-29 9:08 ` Alim Akhtar
2013-08-29 9:44 ` Seungwon Jeon
2013-08-29 10:04 ` Yuvaraj Kumar
2013-08-29 10:10 ` Yuvaraj Kumar
2013-08-29 10:36 ` Seungwon Jeon
2013-08-29 11:46 ` Tomasz Figa
2013-08-30 3:44 ` Seungwon Jeon
2013-08-29 9:42 ` Yuvaraj Kumar
2013-08-29 3:05 ` [RFC V3 0/4] dw_mmc platform specific private data and SMU init Jaehoon Chung
2013-08-29 7:12 ` 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='001601cea4af$42e662f0$c8b328d0$%jun@samsung.com' \
--to=tgih.jun@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=cjb@laptop.org \
--cc=dinguyen@altera.com \
--cc=jh80.chung@samsung.com \
--cc=ks.giri@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=t.figa@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).