1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

env: Adjust the load() method to return an error

The load() methods have inconsistent behaviour on error. Some of them load
an empty default environment. Some load an environment containing an error
message. Others do nothing.

As a step in the right direction, have the method return an error code.
Then the caller could handle this itself in a consistent way.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2017-08-03 12:22:17 -06:00
committed by Tom Rini
parent 21f639446d
commit c595199194
14 changed files with 83 additions and 42 deletions

4
env/flash.c vendored
View File

@@ -308,7 +308,7 @@ done:
#endif /* CONFIG_ENV_ADDR_REDUND */
#ifdef LOADENV
static void env_flash_load(void)
static int env_flash_load(void)
{
#ifdef CONFIG_ENV_ADDR_REDUND
if (gd->env_addr != (ulong)&(flash_addr->data)) {
@@ -352,6 +352,8 @@ static void env_flash_load(void)
#endif /* CONFIG_ENV_ADDR_REDUND */
env_import((char *)flash_addr, 1);
return 0;
}
#endif /* LOADENV */