diff mbox series

env: nowhere: Implement .load callback

Message ID 20200805132955.101132-1-marex@denx.de
State Deferred
Delegated to: Tom Rini
Headers show
Series env: nowhere: Implement .load callback | expand

Commit Message

Marek Vasut Aug. 5, 2020, 1:29 p.m. UTC
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 <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
V2: No change
---
 env/nowhere.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Tom Rini Aug. 5, 2020, 1:41 p.m. UTC | #1
On Wed, Aug 05, 2020 at 03:29:55PM +0200, Marek Vasut wrote:

> 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 <marex@denx.de>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
> V2: No change
> ---
>  env/nowhere.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/env/nowhere.c b/env/nowhere.c
> index d33fdf27d0..a92a84b0c4 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.

This isn't needed with ad3fec2364eb ("env: nowhere: add .load ops").
diff mbox series

Patch

diff --git a/env/nowhere.c b/env/nowhere.c
index d33fdf27d0..a92a84b0c4 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.