mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
dm: mmc: Don't call board_mmc_power_init() with driver model
We should not call out to board code from drivers. With driver model, mmc_power_init() already has code to use a named regulator, but the legacy code path remains. Update the code to make this clear. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
7a61b0b58f
commit
05cbeb7c36
1 changed files with 11 additions and 4 deletions
|
@ -1608,17 +1608,17 @@ static int mmc_send_if_cond(struct mmc *mmc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_DM_MMC
|
||||||
/* board-specific MMC power initializations. */
|
/* board-specific MMC power initializations. */
|
||||||
__weak void board_mmc_power_init(void)
|
__weak void board_mmc_power_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int mmc_power_init(struct mmc *mmc)
|
static int mmc_power_init(struct mmc *mmc)
|
||||||
{
|
{
|
||||||
board_mmc_power_init();
|
#if defined(CONFIG_DM_MMC)
|
||||||
|
#if defined(CONFIG_DM_REGULATOR) && !defined(CONFIG_SPL_BUILD)
|
||||||
#if defined(CONFIG_DM_MMC) && defined(CONFIG_DM_REGULATOR) && \
|
|
||||||
!defined(CONFIG_SPL_BUILD)
|
|
||||||
struct udevice *vmmc_supply;
|
struct udevice *vmmc_supply;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -1634,6 +1634,13 @@ static int mmc_power_init(struct mmc *mmc)
|
||||||
puts("Error enabling VMMC supply\n");
|
puts("Error enabling VMMC supply\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#else /* !CONFIG_DM_MMC */
|
||||||
|
/*
|
||||||
|
* Driver model should use a regulator, as above, rather than calling
|
||||||
|
* out to board code.
|
||||||
|
*/
|
||||||
|
board_mmc_power_init();
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue