[U-Boot] [PATCH v2 12/40] env: Move env_set_ulong() to env.h

Simon Glass
2019-08-01T15:46:47Z

Move env_set_ulong() over to the new header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
---

Changes in v2: None

arch/arm/mach-uniphier/mmc-first-dev.c | 1 +
board/BuR/brppt1/board.c | 1 +
board/BuR/common/br_resetc.c | 1 +
board/CZ.NIC/turris_omnia/turris_omnia.c | 1 +
board/engicam/common/board.c | 1 +
board/gdsys/mpc8308/gazerbeam.c | 1 +
board/grinn/liteboard/board.c | 1 +
board/imgtec/ci20/ci20.c | 1 +
board/synopsys/hsdk/hsdk.c | 1 +
board/warp7/warp7.c | 1 +
cmd/tpm-common.c | 1 +
drivers/bootcount/bootcount_env.c | 1 +
drivers/scsi/scsi.c | 1 +
include/bootcount.h | 1 +
include/common.h | 9 ---------
include/env.h | 9 +++++++++
16 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-uniphier/mmc-first-dev.c b/arch/arm/mach-uniphier/mmc-first-dev.c
index 2f1c109b9e..149e662070 100644
--- a/arch/arm/mach-uniphier/mmc-first-dev.c
+++ b/arch/arm/mach-uniphier/mmc-first-dev.c
@@ -5,6 +5,7 @@
*/

#include <common.h>
+#include <env.h>
#include <mmc.h>
#include <linux/errno.h>

diff --git a/board/BuR/brppt1/board.c b/board/BuR/brppt1/board.c
index b8ab19c0e7..ef4f5c9501 100644
--- a/board/BuR/brppt1/board.c
+++ b/board/BuR/brppt1/board.c
@@ -10,6 +10,7 @@
*/

#include <common.h>
+#include <env.h>
#include <errno.h>
#include <spl.h>
#include <asm/arch/cpu.h>
diff --git a/board/BuR/common/br_resetc.c b/board/BuR/common/br_resetc.c
index c8cc73ab14..c0e7fb65b2 100644
--- a/board/BuR/common/br_resetc.c
+++ b/board/BuR/common/br_resetc.c
@@ -6,6 +6,7 @@
* B&R Industrial Automation GmbH - http://www.br-automation.com/ *
*/
#include <common.h>
+#include <env.h>
#include <errno.h>
#include <i2c.h>
#include <dm/uclass.h>
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index 5f6ea35e5f..418657c2d5 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -8,6 +8,7 @@
*/

#include <common.h>
+#include <env.h>
#include <environment.h>
#include <i2c.h>
#include <miiphy.h>
diff --git a/board/engicam/common/board.c b/board/engicam/common/board.c
index 567b9f63e5..0c47afe5b5 100644
--- a/board/engicam/common/board.c
+++ b/board/engicam/common/board.c
@@ -6,6 +6,7 @@
*/

#include <common.h>
+#include <env.h>
#include <mmc.h>
#include <asm/arch/sys_proto.h>
#include <watchdog.h>
diff --git a/board/gdsys/mpc8308/gazerbeam.c b/board/gdsys/mpc8308/gazerbeam.c
index cd621744d2..ddd6ee8953 100644
--- a/board/gdsys/mpc8308/gazerbeam.c
+++ b/board/gdsys/mpc8308/gazerbeam.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <board.h>
#include <dm.h>
+#include <env.h>
#include <fdt_support.h>
#include <fsl_esdhc.h>
#include <miiphy.h>
diff --git a/board/grinn/liteboard/board.c b/board/grinn/liteboard/board.c
index 1491b8c3d4..1558ea4b84 100644
--- a/board/grinn/liteboard/board.c
+++ b/board/grinn/liteboard/board.c
@@ -17,6 +17,7 @@
#include <asm/mach-imx/boot_mode.h>
#include <asm/io.h>
#include <common.h>
+#include <env.h>
#include <fsl_esdhc_imx.h>
#include <linux/sizes.h>
#include <linux/fb.h>
diff --git a/board/imgtec/ci20/ci20.c b/board/imgtec/ci20/ci20.c
index 9811ef559f..f72a660581 100644
--- a/board/imgtec/ci20/ci20.c
+++ b/board/imgtec/ci20/ci20.c
@@ -7,6 +7,7 @@
*/

#include <common.h>
+#include <env.h>
#include <environment.h>
#include <net.h>
#include <netdev.h>
diff --git a/board/synopsys/hsdk/hsdk.c b/board/synopsys/hsdk/hsdk.c
index ac4d980c49..8a7642a0aa 100644
--- a/board/synopsys/hsdk/hsdk.c
+++ b/board/synopsys/hsdk/hsdk.c
@@ -6,6 +6,7 @@

#include <common.h>
#include <config.h>
+#include <env.h>
#include <linux/printk.h>
#include <linux/kernel.h>
#include <linux/io.h>
diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
index 134a6c99d7..39ae982257 100644
--- a/board/warp7/warp7.c
+++ b/board/warp7/warp7.c
@@ -13,6 +13,7 @@
#include <asm/mach-imx/iomux-v3.h>
#include <asm/io.h>
#include <common.h>
+#include <env.h>
#include <asm/arch/crm_regs.h>
#include <netdev.h>
#include <power/pmic.h>
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index 89f2aa001b..38900fb159 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
#include <dm.h>
+#include <env.h>
#include <asm/unaligned.h>
#include <linux/string.h>
#include <tpm-common.h>
diff --git a/drivers/bootcount/bootcount_env.c b/drivers/bootcount/bootcount_env.c
index 9084ca8a6e..50e0857b3b 100644
--- a/drivers/bootcount/bootcount_env.c
+++ b/drivers/bootcount/bootcount_env.c
@@ -5,6 +5,7 @@
*/

#include <common.h>
+#include <env.h>
#include <environment.h>

void bootcount_store(ulong a)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 75900d8228..48cb2a2818 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -6,6 +6,7 @@

#include <common.h>
#include <dm.h>
+#include <env.h>
#include <pci.h>
#include <scsi.h>
#include <dm/device-internal.h>
diff --git a/include/bootcount.h b/include/bootcount.h
index daee84316c..8fa8cf8218 100644
--- a/include/bootcount.h
+++ b/include/bootcount.h
@@ -9,6 +9,7 @@
#include <common.h>
#include <asm/io.h>
#include <asm/byteorder.h>
+#include <env.h>

#ifdef CONFIG_DM_BOOTCOUNT

diff --git a/include/common.h b/include/common.h
index 100eac6e5e..283cb23fd1 100644
--- a/include/common.h
+++ b/include/common.h
@@ -200,15 +200,6 @@ int env_get_yesno(const char *var);
*/
int env_set(const char *varname, const char *value);

-/**
- * env_set_ulong() - set an environment variable to an integer
- *
- * @varname: Variable to adjust
- * @value: Value to set for the variable (will be converted to a string)
- * @return 0 if OK, 1 on error
- */
-int env_set_ulong(const char *varname, ulong value);
-
void pci_init_board(void);

/* common/exports.c */
diff --git a/include/env.h b/include/env.h
index 5c780f30d6..8898b78b8e 100644
--- a/include/env.h
+++ b/include/env.h
@@ -63,6 +63,15 @@ int env_match(unsigned char *name, int index);
*/
int env_get_f(const char *name, char *buf, unsigned int len);

+/**
+ * env_set_ulong() - set an environment variable to an integer
+ *
+ * @varname: Variable to adjust
+ * @value: Value to set for the variable (will be converted to a string)
+ * @return 0 if OK, 1 on error
+ */
+int env_set_ulong(const char *varname, ulong value);
+
/**
* env_set_hex() - set an environment variable to a hex value
*
--
2.22.0.709.g102302147b-goog