Skip to content

Commit

Permalink
mmc: sdhci-pltfm: Do not use parent as the host's device
Browse files Browse the repository at this point in the history
The code selecting a device for the sdhci host has been
continuously tweaked (4b711cb
"mmc: sdhci-pltfm: Add structure for host-specific data" and
a4d2177 "mmc: sdhci-pltfm: dt
device does not pass parent to sdhci_alloc_host" while there
does not seem to be any reason to use platform device's parent
in the first place.

The comment saying "Some PCI-based MFD need the parent here"
seem to refer to Timberdale FPGA driver (the only MFD driver
registering SDHCI cell, drivers/mfd/timberdale.c) but again,
the only situation when parent device matter is runtime PM,
which is not implemented for Timberdale.

Signed-off-by: Pawel Moll <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
pawelmoll authored and storulf committed Sep 9, 2014
1 parent ca6429d commit 45c19e2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/mmc/host/sdhci-pltfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
size_t priv_size)
{
struct sdhci_host *host;
struct device_node *np = pdev->dev.of_node;
struct resource *iomem;
int ret;

Expand All @@ -136,13 +135,8 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
if (resource_size(iomem) < 0x100)
dev_err(&pdev->dev, "Invalid iomem size!\n");

/* Some PCI-based MFD need the parent here */
if (pdev->dev.parent != &platform_bus && !np)
host = sdhci_alloc_host(pdev->dev.parent,
sizeof(struct sdhci_pltfm_host) + priv_size);
else
host = sdhci_alloc_host(&pdev->dev,
sizeof(struct sdhci_pltfm_host) + priv_size);
host = sdhci_alloc_host(&pdev->dev,
sizeof(struct sdhci_pltfm_host) + priv_size);

if (IS_ERR(host)) {
ret = PTR_ERR(host);
Expand Down

0 comments on commit 45c19e2

Please sign in to comment.