From 0ac7d722ede8e64973f68dbcd07b9521ba04cb63 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Aug 2019 09:47:00 -0600 Subject: env: Move get/set_default_env() to env.h Move these functions to the new header file and rename set_default_env() to env_set_default() so that it has a consistent env_ prefix. Acked-by: Joe Hershberger Signed-off-by: Simon Glass --- env/nand.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'env/nand.c') diff --git a/env/nand.c b/env/nand.c index d0b95f483d3..3e2235f5f34 100644 --- a/env/nand.c +++ b/env/nand.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -325,7 +326,7 @@ static int env_nand_load(void) tmp_env2 = (env_t *)malloc(CONFIG_ENV_SIZE); if (tmp_env1 == NULL || tmp_env2 == NULL) { puts("Can't allocate buffers for environment\n"); - set_default_env("malloc() failed", 0); + env_set_default("malloc() failed", 0); ret = -EIO; goto done; } @@ -364,14 +365,14 @@ static int env_nand_load(void) if (mtd && !get_nand_env_oob(mtd, &nand_env_oob_offset)) { printf("Found Environment offset in OOB..\n"); } else { - set_default_env("no env offset in OOB", 0); + env_set_default("no env offset in OOB", 0); return; } #endif ret = readenv(CONFIG_ENV_OFFSET, (u_char *)buf); if (ret) { - set_default_env("readenv() failed", 0); + env_set_default("readenv() failed", 0); return -EIO; } -- cgit v1.2.3 From f3998fdc4d0871727d7be6838bac750c6323c0a8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 Aug 2019 09:44:25 -0600 Subject: env: Rename environment.h to env_internal.h This file contains lots of internal details about the environment. Most code can include env.h instead, calling the functions there as needed. Rename this file and add a comment at the top to indicate its internal nature. Signed-off-by: Simon Glass Acked-by: Joe Hershberger Reviewed-by: Simon Goldschmidt [trini: Fixup apalis-tk1.c] Signed-off-by: Tom Rini --- env/nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'env/nand.c') diff --git a/env/nand.c b/env/nand.c index 3e2235f5f34..9f3dc635cf1 100644 --- a/env/nand.c +++ b/env/nand.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3