[U-Boot] [PATCH v5 20/30] env: Drop env_relocate_spec() in favour of env_load()

Simon Glass sjg at chromium.org
Thu Aug 3 18:22:07 UTC 2017


This is a strange name for a function that loads the environment. There is
now only one implementation of this function, so use the new env_load()
function directly instead.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Tom Rini <trini at konsulko.com>
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 board/birdland/bav335x/board.c              | 2 +-
 board/gateworks/gw_ventana/gw_ventana_spl.c | 2 +-
 board/tcl/sl50/board.c                      | 2 +-
 board/ti/am335x/board.c                     | 2 +-
 board/ti/am57xx/board.c                     | 2 +-
 board/ti/dra7xx/evm.c                       | 2 +-
 env/common.c                                | 2 +-
 env/env.c                                   | 5 -----
 include/environment.h                       | 9 +++++++--
 9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/board/birdland/bav335x/board.c b/board/birdland/bav335x/board.c
index 67aca3cc43..b49365e157 100644
--- a/board/birdland/bav335x/board.c
+++ b/board/birdland/bav335x/board.c
@@ -162,7 +162,7 @@ int spl_start_uboot(void)
 
 #ifdef CONFIG_SPL_ENV_SUPPORT
 	env_init();
-	env_relocate_spec();
+	env_load();
 	if (getenv_yesno("boot_os") != 1)
 		return 1;
 #endif
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 69a638d71d..baa8480b6c 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -690,7 +690,7 @@ int spl_start_uboot(void)
 	debug("%s\n", __func__);
 #ifdef CONFIG_SPL_ENV_SUPPORT
 	env_init();
-	env_relocate_spec();
+	env_load();
 	debug("boot_os=%s\n", getenv("boot_os"));
 	if (getenv_yesno("boot_os") == 1)
 		ret = 0;
diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c
index e89ee35d30..d3c953e993 100644
--- a/board/tcl/sl50/board.c
+++ b/board/tcl/sl50/board.c
@@ -76,7 +76,7 @@ int spl_start_uboot(void)
 
 #ifdef CONFIG_SPL_ENV_SUPPORT
 	env_init();
-	env_relocate_spec();
+	env_load();
 	if (getenv_yesno("boot_os") != 1)
 		return 1;
 #endif
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 0a16529b5f..ac0592b725 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -249,7 +249,7 @@ int spl_start_uboot(void)
 
 #ifdef CONFIG_SPL_ENV_SUPPORT
 	env_init();
-	env_relocate_spec();
+	env_load();
 	if (getenv_yesno("boot_os") != 1)
 		return 1;
 #endif
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 00a31a97fd..126c9ef694 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -742,7 +742,7 @@ int spl_start_uboot(void)
 
 #ifdef CONFIG_SPL_ENV_SUPPORT
 	env_init();
-	env_relocate_spec();
+	env_load();
 	if (getenv_yesno("boot_os") != 1)
 		return 1;
 #endif
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 7d36f03fa1..23be2c70e4 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -825,7 +825,7 @@ int spl_start_uboot(void)
 
 #ifdef CONFIG_SPL_ENV_SUPPORT
 	env_init();
-	env_relocate_spec();
+	env_load();
 	if (getenv_yesno("boot_os") != 1)
 		return 1;
 #endif
diff --git a/env/common.c b/env/common.c
index 9b3a26859f..0cc8829d0d 100644
--- a/env/common.c
+++ b/env/common.c
@@ -280,7 +280,7 @@ void env_relocate(void)
 		set_default_env("!bad CRC");
 #endif
 	} else {
-		env_relocate_spec();
+		env_load();
 	}
 }
 
diff --git a/env/env.c b/env/env.c
index a239d93156..85d95e5747 100644
--- a/env/env.c
+++ b/env/env.c
@@ -150,11 +150,6 @@ int env_init(void)
 	return 0;
 }
 
-void env_relocate_spec(void)
-{
-	env_load();
-}
-
 int saveenv(void)
 {
 	return env_save();
diff --git a/include/environment.h b/include/environment.h
index 1df243462e..b4f93663da 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -170,8 +170,6 @@ extern env_t environment;
 extern const unsigned char default_environment[];
 extern env_t *env_ptr;
 
-extern void env_relocate_spec(void);
-
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
 extern void env_reloc(void);
 #endif
@@ -320,6 +318,13 @@ struct env_driver *env_driver_lookup_default(void);
  */
 int env_get_char(int index);
 
+/**
+ * env_load() - Load the environment from storage
+ *
+ * @return 0 if OK, -ve on error
+ */
+int env_load(void);
+
 #endif /* DO_DEPS_ONLY */
 
 #endif /* _ENVIRONMENT_H_ */
-- 
2.14.0.rc1.383.gd1ce394fe2-goog



More information about the U-Boot mailing list