[U-Boot] [PATCH v2 05/15] env: Make it explicit where we're loading our environment from
Maxime Ripard
maxime.ripard at free-electrons.com
Tue Jan 16 09:16:41 UTC 2018
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 at chromium.org>
Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
---
env/env.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/env/env.c b/env/env.c
index afffab4c002a..9dd4d4cb4d11 100644
--- a/env/env.c
+++ b/env/env.c
@@ -122,12 +122,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;
@@ -146,12 +149,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;
--
git-series 0.9.1
More information about the U-Boot
mailing list