Skip to contentSkip to conversation

mmc: sdhci-tegra: get_ro(): Retrieve pdata correctly

PATCH In review Stephen Warren 1 participant 2 messages Aug 9, 2011 – Aug 23, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-tegra: get_ro(): Retrieve pdata correctly

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.

---
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(-)
drivers/mmc/host/sdhci-tegra.c +2 -4
index 9329465..406d360 100644
@@ -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;
Signature · 1 line
1.7.0.4

A message that is not in the archive (sent off-list or not yet received): 1312913798-32564-1-git-send-email-swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw

Stephen Warren wrote at Tuesday, August 09, 2011 12:17 PM:

Quoted 8 lines

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.

---
Grant, this patch is for branch devicetree/next; the Tegra DT support doesn't appear to be in other branches yet.

Grant, you can ignore this patch now; I just posted a complete version suitable for inclusion in mainline.

Quoted 22 lines
 drivers/mmc/host/sdhci-tegra.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-tegra.c +2 -5
index 9329465..406d360 100644
@@ -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

Signature · 1 line
nvpublic