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 --- include/environment.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/environment.h b/include/environment.h index ba8af28..03b41e0 100644 --- a/include/environment.h +++ b/include/environment.h @@ -236,8 +236,10 @@ struct env_driver { * * This method is optional. If not provided, no environment will be * loaded. + * + * @return 0 if OK, -ve on error */ - void (*load)(void); + int (*load)(void); /** * save() - Save the environment to storage -- cgit v1.1