From: Thierry Reding <thierry.reding@avionic-design.de>
To: Joseph Lo <josephl@nvidia.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
Chris Ball <cjb@laptop.org>,
"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH 2/2] mmc: tegra: use mmc_of_parse to get the support of standard MMC DT bindings
Date: Thu, 21 Feb 2013 09:03:06 +0100 [thread overview]
Message-ID: <20130221080306.GA7718@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1361427997.5678.59.camel@jlo-ubuntu-64.nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 2590 bytes --]
On Thu, Feb 21, 2013 at 02:26:37PM +0800, Joseph Lo wrote:
> On Thu, 2013-02-21 at 12:20 +0800, Stephen Warren wrote:
> > On 02/20/2013 07:23 PM, Joseph Lo wrote:
> > > On Thu, 2013-02-21 at 01:07 +0800, Stephen Warren wrote:
> > >> On 02/20/2013 12:05 AM, Joseph Lo wrote:
> > >>> Updating the sdhci-tegra driver to use mmc_of_parse to support standard
> > >>> MMC DT bindings. Then we can remove the redundant code that already support
> >
> > >>> @@ -220,15 +203,12 @@ static void sdhci_tegra_parse_dt(struct device *dev,
> > >>> struct sdhci_tegra *tegra_host)
> > >>> {
> > >> ...
> > >>> + struct sdhci_host *host;
> > >> ...
> > >>> + host = platform_get_drvdata(to_platform_device(dev));
> > >>> + mmc_of_parse(host->mmc);
> > >>> }
> > >>
> > >> It might be simpler to change the function prototype to simply pass in
> > >> the host object too.
> > >
> > > It's a interface problem that I can't fix now. If sdhci core is going to
> > > integrate mmc_of_parse into sdhci_get_of_property and mmc_gpio_get_ro
> > > into somethere sdhci_do_get_ro, then we can refine later.
> >
> > I meant to change the prototype of sdhci_tegra_parse_dt(). It would be
> > simple to change that function in this patch.
>
> Hmm. It might not too much different. Which version you prefer?
>
> 1. Original version
>
> 2.
> static void sdhci_tegra_parse_dt(struct device *dev,
> - struct sdhci_tegra *tegra_host)
> + struct sdhci_host *host)
> {
> struct device_node *np = dev->of_node;
> - struct sdhci_host *host;
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> + struct sdhci_tegra *tegra_host = pltfm_host->priv;
>
> tegra_host->power_gpio = of_get_named_gpio(np, "power-gpios",0);
> -
> - host = platform_get_drvdata(to_platform_device(dev));
> mmc_of_parse(host->mmc);
> }
>
> @@ -240,7 +239,7 @@ static int sdhci_tegra_probe(struct platform_device
> *pdev)
> tegra_host->soc_data = soc_data;
> pltfm_host->priv = tegra_host;
>
> - sdhci_tegra_parse_dt(&pdev->dev, tegra_host);
> + sdhci_tegra_parse_dt(&pdev->dev, host);
>
I personally prefer this second version. It keeps with the tradition to
pass a struct device into the *_parse_dt() and also provides easy access
to the sdhci_host.
And on a side-note:
host = platform_get_drvdata(to_platform_device(dev));
can be more simply written as:
host = dev_get_drvdata(dev);
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-02-21 8:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-20 7:05 [PATCH 0/2] mmc: tegra: use mmc_of_parse to get support of standard MMC DT binding Joseph Lo
2013-02-20 7:05 ` [PATCH 1/2] ARM: dts: tegra: fix the activate polarity of cd-gpio in mmc host Joseph Lo
[not found] ` <1361343902-15223-2-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-02-20 16:59 ` Stephen Warren
[not found] ` <512500EB.1070802-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-21 8:18 ` Thierry Reding
[not found] ` <20130221081809.GB7718-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-02-21 8:30 ` Joseph Lo
2013-02-20 7:05 ` [PATCH 2/2] mmc: tegra: use mmc_of_parse to get the support of standard MMC DT bindings Joseph Lo
[not found] ` <1361343902-15223-3-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-02-20 17:07 ` Stephen Warren
[not found] ` <512502D7.4090605-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-21 2:23 ` Joseph Lo
[not found] ` <1361413425.5678.8.camel-yx3yKKdKkHfc7b1ADBJPm0n48jw8i0AO@public.gmane.org>
2013-02-21 4:20 ` Stephen Warren
[not found] ` <5125A075.5000000-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-21 6:26 ` Joseph Lo
2013-02-21 6:34 ` Joseph Lo
2013-02-21 8:03 ` Thierry Reding [this message]
[not found] ` <20130221080306.GA7718-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2013-02-21 8:15 ` Joseph Lo
[not found] ` <1361427997.5678.59.camel-yx3yKKdKkHfc7b1ADBJPm0n48jw8i0AO@public.gmane.org>
2013-02-21 18:50 ` Stephen Warren
2013-02-21 22:44 ` Guennadi Liakhovetski
[not found] ` <Pine.LNX.4.64.1302212333330.10403-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2013-02-22 2:07 ` Joseph Lo
[not found] ` <1361343902-15223-1-git-send-email-josephl-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-02-21 8:24 ` [PATCH 0/2] mmc: tegra: use mmc_of_parse to get support of standard MMC DT binding Thierry Reding
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=20130221080306.GA7718@avionic-0098.mockup.avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=cjb@laptop.org \
--cc=josephl@nvidia.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=swarren@wwwdotorg.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