Skip to content

Commit a4d2177

Browse files
author
Shawn Guo
committed
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>
1 parent 57ed331 commit a4d2177

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/mmc/host/sdhci-pltfm.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
8585
{
8686
struct sdhci_host *host;
8787
struct sdhci_pltfm_host *pltfm_host;
88+
struct device_node *np = pdev->dev.of_node;
8889
struct resource *iomem;
8990
int ret;
9091

@@ -98,7 +99,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
9899
dev_err(&pdev->dev, "Invalid iomem size!\n");
99100

100101
/* Some PCI-based MFD need the parent here */
101-
if (pdev->dev.parent != &platform_bus)
102+
if (pdev->dev.parent != &platform_bus && !np)
102103
host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host));
103104
else
104105
host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));

0 commit comments

Comments
 (0)