summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2018-01-23 21:16:50 +0100
committerTom Rini <trini@konsulko.com>2018-01-27 09:19:11 -0500
commit9c24dfb2b80cba73b79da36321eb23f47d4a9aa3 (patch)
treeab948730b6515646e74aff95b7e30712161e7ebe /env
parent748277c415ff5bd74d6913928cab2a3da6a0b69f (diff)
cmd: nvedit: Get rid of the env lookup
The nvedit command is the only user of env_driver_lookup_default outside of the environment code itself, and it uses it only to print the environment it's about to save to during env save. As we're about to rework the environment to be able to handle multiple environment sources, we might not have an idea of what environment backend is going to be used before trying (and possibly failing for some). Therefore, it makes sense to remove that message and move it to the env_save function itself. As a side effect, we also can get rid of the call to env_driver_lookup_default that is also about to get refactored. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'env')
-rw-r--r--env/env.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/env/env.c b/env/env.c
index 7455632fd3..6195d3b2f3 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__,