dm: mmc: Set up the device pointer when using the MMC uclass
authorSimon Glass <sjg@chromium.org>
Sun, 1 May 2016 19:52:34 +0000 (13:52 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 17 May 2016 15:54:43 +0000 (09:54 -0600)
Update the existing drivers to set up this new pointer. This will be required
by the MMC uclass.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/mmc/omap_hsmmc.c
drivers/mmc/pic32_sdhci.c
drivers/mmc/rockchip_dw_mmc.c
drivers/mmc/socfpga_dw_mmc.c
drivers/mmc/uniphier-sd.c
drivers/mmc/zynq_sdhci.c
include/mmc.h

index 85a832bd420f6d706df9912b0eb3c161915c2469..be34057ea2cef9108cd842c7237fc70726d853a8 100644 (file)
@@ -825,6 +825,7 @@ static int omap_hsmmc_probe(struct udevice *dev)
        gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
 #endif
 
+       mmc->dev = dev;
        upriv->mmc = mmc;
 
        return 0;
index e03d6dd51730f1579769986103fea8ff3bb8e043..abe74293edfdb609dde6fa0d308ff81e17b798bf 100644 (file)
@@ -41,7 +41,12 @@ static int pic32_sdhci_probe(struct udevice *dev)
                return ret;
        }
 
-       return add_sdhci(host, f_min_max[1], f_min_max[0]);
+       ret = add_sdhci(host, f_min_max[1], f_min_max[0]);
+       if (ret)
+               return ret;
+       host->mmc->dev = dev;
+
+       return 0;
 }
 
 static const struct udevice_id pic32_sdhci_ids[] = {
index cb9e1048d0351041e54817e0dc4ab4130ada53ac..0a261c51a84b897139679b9b967d30405ea6cac8 100644 (file)
@@ -104,6 +104,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
        if (ret)
                return ret;
 
+       host->mmc->dev = dev;
        upriv->mmc = host->mmc;
 
        return 0;
index 097db81b05131a63d030983def8c593beac0dfe8..6a0e9719b8a49cb354b46ed711350e2bb47a2293 100644 (file)
@@ -108,6 +108,7 @@ static int socfpga_dwmmc_probe(struct udevice *dev)
                return ret;
 
        upriv->mmc = host->mmc;
+       host->mmc->dev = dev;
 
        return 0;
 }
index 81a80cdbc2ca98728a28ea8466b4bd9c8dfb6bd9..4978cca76d898f712b6091409d7084a77817902d 100644 (file)
@@ -725,6 +725,7 @@ int uniphier_sd_probe(struct udevice *dev)
                return -EIO;
 
        upriv->mmc = priv->mmc;
+       priv->mmc->dev = dev;
 
        return 0;
 }
index b59feca80b5cf1d649e4b03a81eb232ecee38bf6..d405929b64140fa4355bf7c399850ab76a3da645 100644 (file)
@@ -35,6 +35,7 @@ static int arasan_sdhci_probe(struct udevice *dev)
                  CONFIG_ZYNQ_SDHCI_MIN_FREQ);
 
        upriv->mmc = host->mmc;
+       host->mmc->dev = dev;
 
        return 0;
 }
index f01674d9fc86643fc1e140a79cc8edd4cfb1cfa7..6d1f05c328c99bb1cd215b420f3435affe94304b 100644 (file)
@@ -381,6 +381,9 @@ struct mmc {
        char init_in_progress;  /* 1 if we have done mmc_start_init() */
        char preinit;           /* start init as early as possible */
        int ddr_mode;
+#ifdef CONFIG_DM_MMC
+       struct udevice *dev;    /* Device for this MMC controller */
+#endif
 };
 
 struct mmc_hwpart_conf {