summaryrefslogtreecommitdiff
path: root/env/sf.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/sf.c
parentc9d728dd33fe7c45711395c72b2113ea7c18fc72 (diff)
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/sf.c')
-rw-r--r--env/sf.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/env/sf.c b/env/sf.c
index 8f81cf5e40..82babaab67 100644
--- a/env/sf.c
+++ b/env/sf.c
@@ -84,7 +84,7 @@ static int setup_flash_device(void)
#if defined(CONFIG_ENV_OFFSET_REDUND)
#ifdef CMD_SAVEENV
-int saveenv(void)
+static int env_sf_save(void)
{
env_t env_new;
char *saved_buffer = NULL, flag = OBSOLETE_FLAG;
@@ -164,7 +164,7 @@ int saveenv(void)
}
#endif /* CMD_SAVEENV */
-void env_relocate_spec(void)
+static void env_sf_load(void)
{
int ret;
int crc1_ok = 0, crc2_ok = 0;
@@ -249,7 +249,7 @@ out:
}
#else
#ifdef CMD_SAVEENV
-int saveenv(void)
+static int env_sf_save(void)
{
u32 saved_size, saved_offset, sector;
char *saved_buffer = NULL;
@@ -310,7 +310,7 @@ int saveenv(void)
}
#endif /* CMD_SAVEENV */
-void env_relocate_spec(void)
+static void env_sf_load(void)
{
int ret;
char *buf = NULL;
@@ -344,7 +344,7 @@ out:
}
#endif
-int env_init(void)
+static int env_sf_init(void)
{
/* SPI flash isn't usable before relocation */
gd->env_addr = (ulong)&default_environment[0];
@@ -355,10 +355,9 @@ int env_init(void)
U_BOOT_ENV_LOCATION(sf) = {
.location = ENVL_SPI_FLASH,
- .get_char = env_get_char_spec,
- .load = env_relocate_spec,
+ .load = env_sf_load,
#ifdef CMD_SAVEENV
- .save = env_save_ptr(saveenv),
+ .save = env_save_ptr(env_sf_save),
#endif
- .init = env_init,
+ .init = env_sf_init,
};