* [PATCH] env: nowhere: Implement .load callback
@ 2020-05-29 17:51 Marek Vasut
0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2020-05-29 17:51 UTC (permalink / raw)
To: u-boot
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>
---
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")
};
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] env: nowhere: Implement .load callback
@ 2020-08-05 13:29 Marek Vasut
2020-08-05 13:41 ` Tom Rini
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2020-08-05 13:29 UTC (permalink / raw)
To: u-boot
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.
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] env: nowhere: Implement .load callback
2020-08-05 13:29 Marek Vasut
@ 2020-08-05 13:41 ` Tom Rini
0 siblings, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-08-05 13:41 UTC (permalink / raw)
To: u-boot
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").
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200805/eb7490f5/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-05 13:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-29 17:51 [PATCH] env: nowhere: Implement .load callback Marek Vasut
-- strict thread matches above, loose matches on Subject: below --
2020-08-05 13:29 Marek Vasut
2020-08-05 13:41 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox