Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4d2177f authored by Shawn Guo's avatar Shawn Guo
Browse files

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: default avatarShawn Guo <shawn.guo@linaro.org>
Cc: Chris Ball <cjb@laptop.org>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarChris Ball <cjb@laptop.org>
parent 57ed3314
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -85,6 +85,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
{
{
	struct sdhci_host *host;
	struct sdhci_host *host;
	struct sdhci_pltfm_host *pltfm_host;
	struct sdhci_pltfm_host *pltfm_host;
	struct device_node *np = pdev->dev.of_node;
	struct resource *iomem;
	struct resource *iomem;
	int ret;
	int ret;


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


	/* Some PCI-based MFD need the parent here */
	/* 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));
		host = sdhci_alloc_host(pdev->dev.parent, sizeof(*pltfm_host));
	else
	else
		host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));
		host = sdhci_alloc_host(&pdev->dev, sizeof(*pltfm_host));