u-boot-brain/env
Sam Protsenko 49d04c589c env: common: Return specific error code on bad CRC
Callers of env_import*() functions might want to check the case when we
have incorrect environment (with bad CRC). For example, when environment
location is being defined in env_load(), call chain may look like this:

    env_load() -> drv->load() = env_mmc_load() -> env_import()

Return code will be passed from env_import() all way up to env_load().
Right now both env_mmc_load() and env_import() return -EIO error code,
so env_load() can't differentiate between two cases:
  1. Driver reports the error, because device is not accessible
  2. Device is actually accessible, but environment is broken

Let's return -ENOMSG in env_import(), so we can distinguish two cases
mentioned above. It will make it possible to continue working with "bad
CRC" environment (like doing "env save"), instead of considering it not
functional (implemented in subsequent patch).

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-01-26 08:13:56 -05:00
..
attr.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
callback.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
common.c env: common: Return specific error code on bad CRC 2019-01-26 08:13:56 -05:00
eeprom.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
embedded.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
env.c env: sata: Add missed env location for SATA boot 2019-01-09 07:13:32 -05:00
ext4.c env: common: accept flags on reset to default env 2018-07-19 16:17:58 -04:00
fat.c env: common: accept flags on reset to default env 2018-07-19 16:17:58 -04:00
flags.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
flash.c env: allow flash and nand env driver to compile together 2018-12-04 13:07:13 -08:00
Kconfig arm64: versal: Add support for new Xilinx Versal ACAPs 2018-10-16 16:53:21 +02:00
Makefile env: Simplify Makefile using $(SPL_TPL_) 2018-07-21 12:24:31 -04:00
mmc.c env: common: accept flags on reset to default env 2018-07-19 16:17:58 -04:00
nand.c env: allow flash and nand env driver to compile together 2018-12-04 13:07:13 -08:00
nowhere.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
nvram.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
onenand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
remote.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sata.c env: sata: Fix saveenv issue 2019-01-09 07:13:32 -05:00
sf.c Revert "env: sf: fix environment in SPI NOR" 2019-01-21 11:57:58 -05:00
ubi.c env: ubi: Add missing ENV_NAME 2018-08-24 16:00:48 -04:00