[U-Boot] [PATCH v2 14/40] env: Move env_get_yesno() to env.h
Simon Glass
sjg at chromium.org
Thu Aug 1 15:46:49 UTC 2019
Move env_get_yesno() over to the new header file.
Signed-off-by: Simon Glass <sjg at chromium.org>
Acked-by: Joe Hershberger <joe.hershberger at ni.com>
---
Changes in v2: None
arch/powerpc/cpu/mpc85xx/mp.c | 1 +
board/gateworks/gw_ventana/gw_ventana_spl.c | 1 +
cmd/source.c | 1 +
include/common.h | 6 ------
include/env.h | 8 ++++++++
5 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/cpu/mpc85xx/mp.c b/arch/powerpc/cpu/mpc85xx/mp.c
index b0aa72ed6e..119d4b3510 100644
--- a/arch/powerpc/cpu/mpc85xx/mp.c
+++ b/arch/powerpc/cpu/mpc85xx/mp.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <env.h>
#include <asm/processor.h>
#include <ioports.h>
#include <lmb.h>
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 740fc57b91..6886ff9b33 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <env.h>
#include <asm/io.h>
#include <asm/arch/crm_regs.h>
#include <asm/arch/mx6-ddr.h>
diff --git a/cmd/source.c b/cmd/source.c
index 1a9a71aa37..3a51ebf0b6 100644
--- a/cmd/source.c
+++ b/cmd/source.c
@@ -16,6 +16,7 @@
#include <common.h>
#include <command.h>
+#include <env.h>
#include <image.h>
#include <malloc.h>
#include <mapmem.h>
diff --git a/include/common.h b/include/common.h
index 48f443e851..83050073bf 100644
--- a/include/common.h
+++ b/include/common.h
@@ -169,12 +169,6 @@ char *env_get(const char *varname);
*/
ulong env_get_hex(const char *varname, ulong default_val);
-/*
- * Read an environment variable as a boolean
- * Return -1 if variable does not exist (default to true)
- */
-int env_get_yesno(const char *var);
-
/**
* env_set() - set an environment variable
*
diff --git a/include/env.h b/include/env.h
index 9124718f2d..d7190da335 100644
--- a/include/env.h
+++ b/include/env.h
@@ -63,6 +63,14 @@ int env_match(unsigned char *name, int index);
*/
int env_get_f(const char *name, char *buf, unsigned int len);
+/**
+ * env_get_yesno() - Read an environment variable as a boolean
+ *
+ * @return 1 if yes/true (Y/y/T/t), -1 if variable does not exist (i.e. default
+ * to true), 0 if otherwise
+ */
+int env_get_yesno(const char *var);
+
/**
* env_get_ulong() - Return an environment variable as an integer value
*
--
2.22.0.709.g102302147b-goog
More information about the U-Boot
mailing list