diff options
author | Heiko Schocher <hs@denx.de> | 2020-11-03 17:22:36 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-11-03 18:04:25 +0300 |
commit | 46ce9e777c1314ccb78906992b94001194eaa87b (patch) | |
tree | c05f2f20efd6b0463e1dc1908207983c27bc2ddf /arch/microblaze | |
parent | 7a8ac9df5dc0c23620d07933288fc5bea1941c29 (diff) | |
download | u-boot-46ce9e777c1314ccb78906992b94001194eaa87b.tar.xz |
env: sf: fix init function behaviour
Michael wrote:
commit 92765f45bb95 ("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: 92765f45bb95 ("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>
Diffstat (limited to 'arch/microblaze')
0 files changed, 0 insertions, 0 deletions