summaryrefslogtreecommitdiff
path: root/env/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'env/env.c')
-rw-r--r--env/env.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/env/env.c b/env/env.c
index 5cf5bd238f..785a2b8552 100644
--- a/env/env.c
+++ b/env/env.c
@@ -230,6 +230,34 @@ int env_load(void)
return -ENODEV;
}
+int env_reload(void)
+{
+ struct env_driver *drv;
+
+ drv = env_driver_lookup(ENVOP_LOAD, gd->env_load_prio);
+ if (drv) {
+ int ret;
+
+ printf("Loading Environment from %s... ", drv->name);
+
+ if (!env_has_inited(drv->location)) {
+ printf("not initialized\n");
+ return -ENODEV;
+ }
+
+ ret = drv->load();
+ if (ret)
+ printf("Failed (%d)\n", ret);
+ else
+ printf("OK\n");
+
+ if (!ret)
+ return 0;
+ }
+
+ return -ENODEV;
+}
+
int env_save(void)
{
struct env_driver *drv;