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:
4
env/flash.c
vendored
4
env/flash.c
vendored
@@ -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 */
|
||||
|
||||
|
Reference in New Issue
Block a user