aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Protsenko2018-07-30 19:19:26 +0300
committerTom Rini2018-08-10 13:45:34 -0400
commit13bbfb4a395d1c0811cd8624cda64ad2ad4746bf (patch)
treedc535f59ac384295af37b7860a63ab9a40612c9d
parent60a4df32623a77f1bfb6f7361fe2442f03c69edb (diff)
env: Don't show "Failed" error message
"Failed" error message from env_load() only clutters the log with unnecessary details, as we already have all needed warnings by that time. Example: Loading Environment from FAT... MMC: no card present ** Bad device mmc 0 ** Failed (-5) Let's only print it in case when DEBUG is defined to keep log clear. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
-rw-r--r--env/env.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/env/env.c b/env/env.c
index e033b461244..afed0f3c95c 100644
--- a/env/env.c
+++ b/env/env.c
@@ -186,14 +186,18 @@ int env_load(void)
continue;
printf("Loading Environment from %s... ", drv->name);
+ /*
+ * In error case, the error message must be printed during
+ * drv->load() in some underlying API, and it must be exactly
+ * one message.
+ */
ret = drv->load();
- if (ret)
- printf("Failed (%d)\n", ret);
- else
+ if (ret) {
+ debug("Failed (%d)\n", ret);
+ } else {
printf("OK\n");
-
- if (!ret)
return 0;
+ }
}
/*