From: Shawn Guo <shawn.guo@linaro.org>
To: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
devicetree-discuss@lists.ozlabs.org, patches@linaro.org,
Shawn Guo <shawn.guo@linaro.org>, Chris Ball <cjb@laptop.org>,
Grant Likely <grant.likely@secretlab.ca>
Subject: [PATCH 2/3] mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host
Date: Sun, 3 Jul 2011 16:30:50 +0800 [thread overview]
Message-ID: <1309681851-23052-3-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1309681851-23052-1-git-send-email-shawn.guo@linaro.org>
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>
---
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
next prev parent reply other threads:[~2011-07-03 8:30 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 ` Shawn Guo [this message]
2011-07-04 6:22 ` [PATCH 2/3] mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host Grant Likely
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=1309681851-23052-3-git-send-email-shawn.guo@linaro.org \
--to=shawn.guo@linaro.org \
--cc=cjb@laptop.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=patches@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).