From 42a1820bbcc7dfedcf625b88a1013c11e9ef6709 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 31 Jan 2018 14:47:10 +0100 Subject: env: make env_import(_redund) return 0 on success, not 1 env_import (and env_import_redund) currently return 1 on success and 0 on error. However, they are only used from functions returning 0 on success or a negative value on error. Let's clean this up by making env_import and env_import_redund return 0 on success and -EIO on error (as was the case for all users before). Users that cared for the return value are also updated. Funny enough, this only affects onenand.c and sf.c Signed-off-by: Simon Goldschmidt Acked-by: Maxime Ripard --- env/sf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'env/sf.c') diff --git a/env/sf.c b/env/sf.c index a2e4c93631..3dc54410df 100644 --- a/env/sf.c +++ b/env/sf.c @@ -236,7 +236,7 @@ static int env_sf_load(void) ep = tmp_env2; ret = env_import((char *)ep, 0); - if (!ret) { + if (ret) { pr_err("Cannot import environment: errno = %d\n", errno); set_default_env("!env_import failed"); } @@ -336,7 +336,7 @@ static int env_sf_load(void) } ret = env_import(buf, 1); - if (ret) + if (!ret) gd->env_valid = ENV_VALID; err_read: -- cgit v1.2.3