From 2166ebf7831674508425daf50c78e481083c6462 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 31 Jan 2018 14:47:12 +0100 Subject: env: make env drivers propagate env_import return value For multiple env drivers to correctly implement fallback when one environment fails to load (e.g. crc error), the return value of env_import has to be propagated by all env driver's load function. Without this change, the first driver that succeeds to load an environment with an invalid CRC return 0 (success) and no other drivers are checked. Signed-off-by: Simon Goldschmidt Acked-by: Maxime Ripard --- env/flash.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'env/flash.c') diff --git a/env/flash.c b/env/flash.c index bac10ff..ccade77 100644 --- a/env/flash.c +++ b/env/flash.c @@ -351,9 +351,7 @@ static int env_flash_load(void) "reading environment; recovered successfully\n\n"); #endif /* CONFIG_ENV_ADDR_REDUND */ - env_import((char *)flash_addr, 1); - - return 0; + return env_import((char *)flash_addr, 1); } #endif /* LOADENV */ -- cgit v1.1