aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/nvedit.c4
-rw-r--r--env/env.c4
-rw-r--r--include/environment.h7
3 files changed, 3 insertions, 12 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 4e79d03..a690d74 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -708,10 +708,6 @@ ulong env_get_ulong(const char *name, int base, ulong default_val)
static int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
- struct env_driver *env = env_driver_lookup_default();
-
- printf("Saving Environment to %s...\n", env->name);
-
return env_save() ? 1 : 0;
}
diff --git a/env/env.c b/env/env.c
index 7455632..6195d3b 100644
--- a/env/env.c
+++ b/env/env.c
@@ -54,7 +54,7 @@ static enum env_location env_get_default_location(void)
return ENVL_UNKNOWN;
}
-struct env_driver *env_driver_lookup_default(void)
+static struct env_driver *env_driver_lookup_default(void)
{
enum env_location loc = env_get_default_location();
struct env_driver *drv;
@@ -117,6 +117,8 @@ int env_save(void)
return -ENODEV;
if (!drv->save)
return -ENOSYS;
+
+ printf("Saving Environment to %s...\n", drv->name);
ret = drv->save();
if (ret) {
debug("%s: Environment failed to save (err=%d)\n", __func__,
diff --git a/include/environment.h b/include/environment.h
index d29f82c..a2015c2 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -293,13 +293,6 @@ int env_import_redund(const char *buf1, const char *buf2);
#endif
/**
- * env_driver_lookup_default() - Look up the default environment driver
- *
- * @return pointer to driver, or NULL if none (which should not happen)
- */
-struct env_driver *env_driver_lookup_default(void);
-
-/**
* env_get_char() - Get a character from the early environment
*
* This reads from the pre-relocation environemnt