[PATCH] mmc: sdhci-tegra: get_ro(): Retrieve pdata correctly

Stephen Warren swarren at nvidia.com
Wed Aug 10 04:16:38 EST 2011


The active platform data pointer is stored as pltfm_host->priv, and not
always in the platform device itself. In particular, the platform data in
the platform device is NULL when the platform data comes from Device Tree.

Signed-off-by: Stephen Warren <swarren at nvidia.com>
---
Grant, this patch is for branch devicetree/next; the Tegra DT support
doesn't appear to be in other branches yet.

 drivers/mmc/host/sdhci-tegra.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 9329465..406d360 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -74,10 +74,8 @@ static void tegra_sdhci_writel(struct sdhci_host *host, u32 val, int reg)
 
 static unsigned int tegra_sdhci_get_ro(struct sdhci_host *sdhci)
 {
-	struct platform_device *pdev = to_platform_device(mmc_dev(sdhci->mmc));
-	struct tegra_sdhci_platform_data *plat;
-
-	plat = pdev->dev.platform_data;
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
+	struct tegra_sdhci_platform_data *plat = pltfm_host->priv;
 
 	if (!gpio_is_valid(plat->wp_gpio))
 		return -1;
-- 
1.7.0.4



More information about the devicetree-discuss mailing list