env: Move get_env_id() to env.h

Move this function over to the new header file. Also rename it to have an
env_ prefix like the other functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 46b1e60..4f3edab 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -27,6 +27,7 @@
 #include <cli.h>
 #include <command.h>
 #include <console.h>
+#include <env.h>
 #include <environment.h>
 #include <search.h>
 #include <errno.h>
@@ -69,14 +70,14 @@
 
 /*
  * This variable is incremented on each do_env_set(), so it can
- * be used via get_env_id() as an indication, if the environment
+ * be used via env_get_id() as an indication, if the environment
  * has changed or not. So it is possible to reread an environment
  * variable only if the environment was changed ... done so for
  * example in NetInitLoop()
  */
 static int env_id = 1;
 
-int get_env_id(void)
+int env_get_id(void)
 {
 	return env_id;
 }
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ce5a15e..73005ff 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
 #include <stdio_dev.h>
 #include <net.h>
 
@@ -55,7 +56,7 @@
 	static struct in_addr netmask;
 	static struct in_addr our_ip;
 	static int env_changed_id;
-	int env_id = get_env_id();
+	int env_id = env_get_id();
 
 	/* update only when the environment has changed */
 	if (env_changed_id != env_id) {
@@ -75,7 +76,7 @@
 {
 	const char *p;
 	static int env_changed_id;
-	int env_id = get_env_id();
+	int env_id = env_get_id();
 
 	/* update only when the environment has changed */
 	if (env_changed_id != env_id) {
diff --git a/include/common.h b/include/common.h
index 6b89047..997da85 100644
--- a/include/common.h
+++ b/include/common.h
@@ -247,8 +247,6 @@
 	return env_set_hex(varname, (ulong)addr);
 }
 
-int get_env_id (void);
-
 void	pci_init_board(void);
 
 /* common/exports.c */
diff --git a/include/env.h b/include/env.h
index 157ee9b..b82d80d 100644
--- a/include/env.h
+++ b/include/env.h
@@ -12,6 +12,16 @@
 #include <stdbool.h>
 
 /**
+ * env_get_id() - Gets a sequence number for the environment
+ *
+ * This value increments every time the environment changes, so can be used an
+ * an indication of this
+ *
+ * @return environment ID
+ */
+int env_get_id(void);
+
+/**
  * env_complete() - return an auto-complete for environment variables
  *
  * @var: partial name to auto-complete
diff --git a/net/eth_common.c b/net/eth_common.c
index 63f9379..dcc5918 100644
--- a/net/eth_common.c
+++ b/net/eth_common.c
@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <env.h>
 #include <environment.h>
 #include <miiphy.h>
 #include <net.h>
@@ -110,7 +111,7 @@
 	static int  env_changed_id;
 	int	env_id;
 
-	env_id = get_env_id();
+	env_id = env_get_id();
 	if ((act == NULL) || (env_changed_id != env_id)) {
 		act = env_get("ethact");
 		env_changed_id = env_id;