aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--env/env.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/env/env.c b/env/env.c
index 2e64346..bcc68c6 100644
--- a/env/env.c
+++ b/env/env.c
@@ -131,8 +131,6 @@ __weak enum env_location env_get_location(enum env_operation op, int prio)
if (prio >= ARRAY_SIZE(env_locations))
return ENVL_UNKNOWN;
- gd->env_load_prio = prio;
-
return env_locations[prio];
}
@@ -204,6 +202,8 @@ int env_load(void)
ret = drv->load();
if (!ret) {
printf("OK\n");
+ gd->env_load_prio = prio;
+
return 0;
} else if (ret == -ENOMSG) {
/* Handle "bad CRC" case */
@@ -227,7 +227,8 @@ int env_load(void)
debug("Selecting environment with bad CRC\n");
else
best_prio = 0;
- env_get_location(ENVOP_LOAD, best_prio);
+
+ gd->env_load_prio = best_prio;
return -ENODEV;
}