Skip to content

Commit

Permalink
env: Don't show "Failed" error message
Browse files Browse the repository at this point in the history
"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 <[email protected]>
  • Loading branch information
Sam Protsenko authored and trini committed Aug 10, 2018
1 parent 60a4df3 commit 13bbfb4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions env/env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

/*
Expand Down

0 comments on commit 13bbfb4

Please sign in to comment.