summaryrefslogtreecommitdiff
path: root/env/mmc.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-03 12:22:01 -0600
committerTom Rini <trini@konsulko.com>2017-08-15 20:50:27 -0400
commite5bce247b01ae057f05cc80178f0df28ec1d27a7 (patch)
tree98a5f6c12ce94369f76db33a6347791392003241 /env/mmc.c
parentc9d728dd33fe7c45711395c72b2113ea7c18fc72 (diff)
downloadu-boot-e5bce247b01ae057f05cc80178f0df28ec1d27a7.tar.gz
u-boot-e5bce247b01ae057f05cc80178f0df28ec1d27a7.tar.bz2
u-boot-e5bce247b01ae057f05cc80178f0df28ec1d27a7.zip
env: Switch over to use environment location drivers
Move over to use a the master implementation of the location drivers, with each method calling out to the appropriate driver. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'env/mmc.c')
-rw-r--r--env/mmc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/env/mmc.c b/env/mmc.c
index 0d1e8077d3..d63feea2b8 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -82,7 +82,7 @@ __weak int mmc_get_env_dev(void)
return CONFIG_SYS_MMC_ENV_DEV;
}
-int env_init(void)
+static int env_mmc_init(void)
{
/* use default */
gd->env_addr = (ulong)&default_environment[0];
@@ -145,7 +145,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
#endif
}
-#ifdef CONFIG_CMD_SAVEENV
+#if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_SPL_BUILD)
static inline int write_env(struct mmc *mmc, unsigned long size,
unsigned long offset, const void *buffer)
{
@@ -160,7 +160,7 @@ static inline int write_env(struct mmc *mmc, unsigned long size,
return (n == blk_cnt) ? 0 : -1;
}
-int saveenv(void)
+static int env_mmc_save(void)
{
ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
int dev = mmc_get_env_dev();
@@ -207,7 +207,7 @@ fini:
fini_mmc_for_env(mmc);
return ret;
}
-#endif /* CONFIG_CMD_SAVEENV */
+#endif /* CONFIG_CMD_SAVEENV && !CONFIG_SPL_BUILD */
static inline int read_env(struct mmc *mmc, unsigned long size,
unsigned long offset, const void *buffer)
@@ -224,7 +224,7 @@ static inline int read_env(struct mmc *mmc, unsigned long size,
}
#ifdef CONFIG_ENV_OFFSET_REDUND
-void env_relocate_spec(void)
+static void env_mmc_load(void)
{
#if !defined(ENV_IS_EMBEDDED)
struct mmc *mmc;
@@ -284,7 +284,7 @@ err:
#endif
}
#else /* ! CONFIG_ENV_OFFSET_REDUND */
-void env_relocate_spec(void)
+static void env_mmc_load(void)
{
#if !defined(ENV_IS_EMBEDDED)
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
@@ -327,10 +327,9 @@ err:
U_BOOT_ENV_LOCATION(mmc) = {
.location = ENVL_MMC,
- .get_char = env_get_char_spec,
- .load = env_relocate_spec,
+ .load = env_mmc_load,
#ifndef CONFIG_SPL_BUILD
- .save = env_save_ptr(saveenv),
+ .save = env_save_ptr(env_mmc_save),
#endif
- .init = env_init,
+ .init = env_mmc_init,
};