]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host
authorShawn Guo <shawn.guo@linaro.org>
Fri, 1 Jul 2011 01:35:28 +0000 (09:35 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Wed, 27 Jul 2011 01:31:33 +0000 (09:31 +0800)
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>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci-pltfm.c

index 71c0ce1f6db08be407aa291b4501b0d4a5b5433f..6414efeddca0bb4475cd2fafa4d201dd2af77747 100644 (file)
@@ -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));