From: Tom Rini Date: Tue, 3 Nov 2020 11:19:21 -0500 Subject: [PATCH] env: sf: fix init function behaviour In-Reply-To: <20201103142236.48090-1-hs@denx.de> References: <20201103142236.48090-1-hs@denx.de> Message-ID: <20201103161921.GR5340@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Nov 03, 2020 at 03:22:36PM +0100, Heiko Schocher wrote: > 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 > Tested-by: Michael Walle [For the SF environment] > Signed-off-by: Heiko Schocher Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: