Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-pltfm: dt device does not pass parent to sdhci_alloc_host

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>

Shawn Guo a4d2177f 57ed3314

+2 -1
+2 -1
drivers/mmc/host/sdhci-pltfm.c
··· 85 85 { 86 86 struct sdhci_host *host; 87 87 struct sdhci_pltfm_host *pltfm_host; 88 + struct device_node *np = pdev->dev.of_node; 88 89 struct resource *iomem; 89 90 int ret; 90 91 ··· 99 98 dev_err(&pdev->dev, "Invalid iomem size!\n"); 100 99 101 100 /* Some PCI-based MFD need the parent here */ 102 - if (pdev->dev.parent != &platform_bus) 101 + if (pdev->dev.parent != &platform_bus && !np) 103 102 host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host)); 104 103 else 105 104 host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));