From c5951991942330c129f3b181e94969d7c01e9abb Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Aug 2017 12:22:17 -0600 Subject: 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 --- env/flash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'env/flash.c') diff --git a/env/flash.c b/env/flash.c index 2d72c51622..b60be57a8d 100644 --- a/env/flash.c +++ b/env/flash.c @@ -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 */ -- cgit