Skip to contentSkip to conversation

env: nowhere: Implement .load callback

PATCH New Marek Vasut 1 participant 1 message May 29, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env: nowhere: Implement .load callback

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.

---
 env/nowhere.c | 7 +++++++
 1 file changed, 7 insertions(+)
env/nowhere.c +7 -0
index f5b0a17652..417a636f83 100644
@@ -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")
 };
Signature · 1 line
2.25.1