diff options
author | Simon Glass <sjg@chromium.org> | 2017-04-22 19:10:56 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-06-01 07:03:04 -0600 |
commit | 05cbeb7c3612da8d4bafa82be05092450a500052 (patch) | |
tree | 3cb93562c7a9bc6df4978fc69b1af7960cbab273 /drivers/mmc/mmc.c | |
parent | 7a61b0b58f560ec0c29cbfa276aa938f76ea06b3 (diff) |
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>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r-- | drivers/mmc/mmc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 72fc17716e..3cdf6a4f3b 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1608,17 +1608,17 @@ static int mmc_send_if_cond(struct mmc *mmc) return 0; } +#ifndef CONFIG_DM_MMC /* board-specific MMC power initializations. */ __weak void board_mmc_power_init(void) { } +#endif static int mmc_power_init(struct mmc *mmc) { - board_mmc_power_init(); - -#if defined(CONFIG_DM_MMC) && defined(CONFIG_DM_REGULATOR) && \ - !defined(CONFIG_SPL_BUILD) +#if defined(CONFIG_DM_MMC) +#if defined(CONFIG_DM_REGULATOR) && !defined(CONFIG_SPL_BUILD) struct udevice *vmmc_supply; int ret; @@ -1635,6 +1635,13 @@ static int mmc_power_init(struct mmc *mmc) 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 return 0; } |