diff options
author | Simon Goldschmidt <sgoldschmidt@de.pepperl-fuchs.com> | 2018-01-31 14:47:10 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-01-31 18:45:10 -0500 |
commit | 42a1820bbcc7dfedcf625b88a1013c11e9ef6709 (patch) | |
tree | 5ad1234769e5fd1f4745399a544115b1d7d3130b /env/onenand.c | |
parent | 87c7fb396a59d3e2be434cc956462ba46451193b (diff) | |
download | u-boot-42a1820bbcc7dfedcf625b88a1013c11e9ef6709.zip u-boot-42a1820bbcc7dfedcf625b88a1013c11e9ef6709.tar.gz u-boot-42a1820bbcc7dfedcf625b88a1013c11e9ef6709.tar.bz2 |
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 <sgoldschmidt@de.pepperl-fuchs.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'env/onenand.c')
-rw-r--r-- | env/onenand.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/env/onenand.c b/env/onenand.c index 2e3045c..10a8ccc 100644 --- a/env/onenand.c +++ b/env/onenand.c @@ -57,10 +57,10 @@ static int env_onenand_load(void) #endif /* !ENV_IS_EMBEDDED */ rc = env_import(buf, 1); - if (rc) + if (!rc) gd->env_valid = ENV_VALID; - return rc ? 0 : -EIO; + return rc; } static int env_onenand_save(void) |