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/nvram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'env/nvram.c') diff --git a/env/nvram.c b/env/nvram.c index 85af37d..5fb3115 100644 --- a/env/nvram.c +++ b/env/nvram.c @@ -51,7 +51,7 @@ static int env_nvram_get_char(int index) } #endif -static void env_nvram_load(void) +static int env_nvram_load(void) { char buf[CONFIG_ENV_SIZE]; @@ -61,6 +61,8 @@ static void env_nvram_load(void) memcpy(buf, (void *)CONFIG_ENV_ADDR, CONFIG_ENV_SIZE); #endif env_import(buf, 1); + + return 0; } static int env_nvram_save(void) -- cgit v1.1