From patchwork Wed Jun 3 00:01:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 241588 List-Id: U-Boot discussion From: marex at denx.de (Marek Vasut) Date: Wed, 3 Jun 2020 02:01:09 +0200 Subject: [PATCH 4/6] env: nowhere: Implement .load callback In-Reply-To: <20200603000111.7919-1-marex@denx.de> References: <20200603000111.7919-1-marex@denx.de> Message-ID: <20200603000111.7919-4-marex@denx.de> Add .load callback for the 'nowhere' environment driver. This is useful for when the 'nowhere' driver is used in combination with other drivers and should be used to load the default environment. Signed-off-by: Marek Vasut Reviewed-by: Tom Rini --- env/nowhere.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/env/nowhere.c b/env/nowhere.c index f5b0a17652..417a636f83 100644 --- a/env/nowhere.c +++ b/env/nowhere.c @@ -15,6 +15,12 @@ DECLARE_GLOBAL_DATA_PTR; +static int env_nowhere_load(void) +{ + env_set_default(NULL, 0); + + return 0; +} /* * Because we only ever have the default environment available we must mark * it as invalid. @@ -30,5 +36,6 @@ static int env_nowhere_init(void) U_BOOT_ENV_LOCATION(nowhere) = { .location = ENVL_NOWHERE, .init = env_nowhere_init, + .load = env_nowhere_load, ENV_NAME("nowhere") };