From: Grant Likely <grant.likely@secretlab.ca>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
devicetree-discuss@lists.ozlabs.org, patches@linaro.org,
Chris Ball <cjb@laptop.org>
Subject: Re: [PATCH 2/3] mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host
Date: Mon, 4 Jul 2011 00:22:30 -0600 [thread overview]
Message-ID: <20110704062230.GH15152@ponder.secretlab.ca> (raw)
In-Reply-To: <1309681851-23052-3-git-send-email-shawn.guo@linaro.org>
On Sun, Jul 03, 2011 at 04:30:50PM +0800, Shawn Guo wrote:
> Neither platform based nor dt based device needs to pass the parent
> to sdhci_alloc_host. There is no difference between platform and dt
> on this point.
>
> The patch makes the change to pass device itself than its parent to
> sdhci_alloc_host for dt case too. Otherwise the probe function of
> sdhci based drivers which is shared between platform and dt will
> fail on dt case.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Chris Ball <cjb@laptop.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> drivers/mmc/host/sdhci-pltfm.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> index 71c0ce1..6414efe 100644
> --- a/drivers/mmc/host/sdhci-pltfm.c
> +++ b/drivers/mmc/host/sdhci-pltfm.c
> @@ -85,6 +85,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
> {
> struct sdhci_host *host;
> struct sdhci_pltfm_host *pltfm_host;
> + struct device_node *np = pdev->dev.of_node;
> struct resource *iomem;
> int ret;
>
> @@ -98,7 +99,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
> dev_err(&pdev->dev, "Invalid iomem size!\n");
>
> /* Some PCI-based MFD need the parent here */
> - if (pdev->dev.parent != &platform_bus)
> + if (pdev->dev.parent != &platform_bus && !np)
> host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host));
> else
> host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));
> --
> 1.7.4.1
>
prev parent reply other threads:[~2011-07-04 6:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-03 8:30 [PATCH 0/3] Add device tree probe for sdhci-esdhc-imx Shawn Guo
[not found] ` <1309681851-23052-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-07-03 8:30 ` [PATCH 1/3] mmc: sdhci-esdhc-imx: get rid of the uses of cpu_is_mx() Shawn Guo
2011-07-04 6:21 ` Grant Likely
2011-07-03 8:30 ` [PATCH 3/3] mmc: sdhci-esdhc-imx: add device tree probe support Shawn Guo
2011-07-04 6:25 ` Grant Likely
2011-07-05 15:35 ` Shawn Guo
2011-07-05 17:20 ` Grant Likely
2011-07-03 8:30 ` [PATCH 2/3] mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host Shawn Guo
2011-07-04 6:22 ` Grant Likely [this message]
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=20110704062230.GH15152@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=cjb@laptop.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=patches@linaro.org \
--cc=shawn.guo@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;
as well as URLs for NNTP newsgroup(s).