u-boot/env
Heiko Schocher 46ce9e777c env: sf: fix init function behaviour
Michael wrote:
commit 92765f45bb ("env: Access Environment in SPI flashes before
relocation") at least breaks the Kontron sl28 board. I guess it also
breaks others which use a (late) SPI environment.

reason is, that env_init() sets the init bit, if there
is no init function defined in an environment driver,
and use default return value -ENOENT in this case
later for setting the default environment.

Change:
Environment driver can now implement an init
function and return, if this function does nothing,
simply -ENOENT.

env_init() now handles -ENOENT correct by setting the
inited bit for the environment driver. And if there
is no other environment driver whose init function
returns 0, load than the default environment.

This prevents that each environment driver needs to set the
default environment.

Fixes: 92765f45bb ("env: Access Environment in SPI flashes before relocation")
Reported-by: Michael Walle <michael@walle.cc>
Tested-by: Michael Walle <michael@walle.cc> [For the SF environment]
Signed-off-by: Heiko Schocher <hs@denx.de>
2020-11-03 10:04:25 -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 make env_entry::callback conditional on !CONFIG_SPL_BUILD 2020-04-24 10:09:59 -04:00
common.c env: split env_import_redund() into 2 functions 2020-10-30 10:54:38 -04:00
eeprom.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
embedded.c env: Finish migration of common ENV options 2019-11-20 18:32:09 -05:00
env.c env: sf: fix init function behaviour 2020-11-03 10:04:25 -05:00
ext4.c env/ext4.c: allow loading from an EXT4 partition on the MMC boot device 2020-10-14 11:16:34 -04:00
fat.c mmc: remove duplicate mmc_get_env_dev() implementations 2020-10-14 11:16:34 -04:00
flags.c env: Add support for explicit write access list 2020-07-31 10:13:00 -04:00
flash.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
Kconfig env: Access Environment in SPI flashes before relocation 2020-10-30 10:54:38 -04:00
Makefile env: remove callback.o for an SPL build 2020-04-24 10:09:59 -04:00
mmc.c mmc: remove duplicate mmc_get_env_dev() implementations 2020-10-14 11:16:34 -04:00
nand.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
nowhere.c env: nowhere: add .load ops 2020-07-31 10:13:00 -04:00
nvram.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
onenand.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
remote.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
sata.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00
sf.c env: sf: fix init function behaviour 2020-11-03 10:04:25 -05:00
ubi.c env: Discern environment coming from external storage 2020-07-31 10:13:00 -04:00