]> git.sur5r.net Git - u-boot/commitdiff
env: Make it explicit where we're loading our environment from
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 23 Jan 2018 20:16:54 +0000 (21:16 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 27 Jan 2018 14:19:11 +0000 (09:19 -0500)
Since we can have multiple environments now, it's better to provide a
decent indication on what environments were tried and which were the one to
fail and succeed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
env/env.c

index 157f1e6568c42976820b257f4de06a2aec82496b..14324bbdd207945a63c01f297a5feb7dfd4aea8a 100644 (file)
--- a/env/env.c
+++ b/env/env.c
@@ -146,12 +146,15 @@ int env_load(void)
                if (!drv->load)
                        continue;
 
+               printf("Loading Environment from %s... ", drv->name);
                ret = drv->load();
+               if (ret)
+                       printf("Failed (%d)\n", ret);
+               else
+                       printf("OK\n");
+
                if (!ret)
                        return 0;
-
-               debug("%s: Environment %s failed to load (err=%d)\n", __func__,
-                     drv->name, ret);
        }
 
        return -ENODEV;
@@ -170,12 +173,13 @@ int env_save(void)
 
                printf("Saving Environment to %s... ", drv->name);
                ret = drv->save();
-               printf("%s\n", ret ? "Failed" : "OK");
+               if (ret)
+                       printf("Failed (%d)\n", ret);
+               else
+                       printf("OK\n");
+
                if (!ret)
                        return 0;
-
-               debug("%s: Environment %s failed to save (err=%d)\n", __func__,
-                     drv->name, ret);
        }
 
        return -ENODEV;