dm: mmc: Set up the device pointer when using the MMC uclass
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>
This commit is contained in:
		
							parent
							
								
									b6694a33c4
								
							
						
					
					
						commit
						cffe5d86cf
					
				|  | @ -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); | 	gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN); | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | 	mmc->dev = dev; | ||||||
| 	upriv->mmc = mmc; | 	upriv->mmc = mmc; | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
|  |  | ||||||
|  | @ -41,7 +41,12 @@ static int pic32_sdhci_probe(struct udevice *dev) | ||||||
| 		return ret; | 		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[] = { | static const struct udevice_id pic32_sdhci_ids[] = { | ||||||
|  |  | ||||||
|  | @ -104,6 +104,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev) | ||||||
| 	if (ret) | 	if (ret) | ||||||
| 		return ret; | 		return ret; | ||||||
| 
 | 
 | ||||||
|  | 	host->mmc->dev = dev; | ||||||
| 	upriv->mmc = host->mmc; | 	upriv->mmc = host->mmc; | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
|  |  | ||||||
|  | @ -108,6 +108,7 @@ static int socfpga_dwmmc_probe(struct udevice *dev) | ||||||
| 		return ret; | 		return ret; | ||||||
| 
 | 
 | ||||||
| 	upriv->mmc = host->mmc; | 	upriv->mmc = host->mmc; | ||||||
|  | 	host->mmc->dev = dev; | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -725,6 +725,7 @@ int uniphier_sd_probe(struct udevice *dev) | ||||||
| 		return -EIO; | 		return -EIO; | ||||||
| 
 | 
 | ||||||
| 	upriv->mmc = priv->mmc; | 	upriv->mmc = priv->mmc; | ||||||
|  | 	priv->mmc->dev = dev; | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -35,6 +35,7 @@ static int arasan_sdhci_probe(struct udevice *dev) | ||||||
| 		  CONFIG_ZYNQ_SDHCI_MIN_FREQ); | 		  CONFIG_ZYNQ_SDHCI_MIN_FREQ); | ||||||
| 
 | 
 | ||||||
| 	upriv->mmc = host->mmc; | 	upriv->mmc = host->mmc; | ||||||
|  | 	host->mmc->dev = dev; | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -381,6 +381,9 @@ struct mmc { | ||||||
| 	char init_in_progress;	/* 1 if we have done mmc_start_init() */ | 	char init_in_progress;	/* 1 if we have done mmc_start_init() */ | ||||||
| 	char preinit;		/* start init as early as possible */ | 	char preinit;		/* start init as early as possible */ | ||||||
| 	int ddr_mode; | 	int ddr_mode; | ||||||
|  | #ifdef CONFIG_DM_MMC | ||||||
|  | 	struct udevice *dev;	/* Device for this MMC controller */ | ||||||
|  | #endif | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| struct mmc_hwpart_conf { | struct mmc_hwpart_conf { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue