summaryrefslogtreecommitdiff
path: root/env/common.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-01 09:47:00 -0600
committerTom Rini <trini@konsulko.com>2019-08-11 16:43:41 -0400
commit0ac7d722ede8e64973f68dbcd07b9521ba04cb63 (patch)
tree179942d65436fafe8d1c3193bd15913f3b2c5f18 /env/common.c
parent1f3db0c135fcaf40ff88bdcd058b56bc7e1f58f3 (diff)
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 <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'env/common.c')
-rw-r--r--env/common.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/env/common.c b/env/common.c
index db2a033f68..1d9d0f934d 100644
--- a/env/common.c
+++ b/env/common.c
@@ -62,7 +62,7 @@ char *env_get_default(const char *name)
return ret_val;
}
-void set_default_env(const char *s, int flags)
+void env_set_default(const char *s, int flags)
{
if (sizeof(default_environment) > ENV_SIZE) {
puts("*** Error - default environment is too large\n\n");
@@ -118,7 +118,7 @@ int env_import(const char *buf, int check)
memcpy(&crc, &ep->crc, sizeof(crc));
if (crc32(0, ep->data, ENV_SIZE) != crc) {
- set_default_env("bad CRC", 0);
+ env_set_default("bad CRC", 0);
return -ENOMSG; /* needed for env_load() */
}
}
@@ -131,7 +131,7 @@ int env_import(const char *buf, int check)
pr_err("Cannot import environment: errno = %d\n", errno);
- set_default_env("import failed", 0);
+ env_set_default("import failed", 0);
return -EIO;
}
@@ -156,7 +156,7 @@ int env_import_redund(const char *buf1, int buf1_read_fail,
}
if (buf1_read_fail && buf2_read_fail) {
- set_default_env("bad env area", 0);
+ env_set_default("bad env area", 0);
return -EIO;
} else if (!buf1_read_fail && buf2_read_fail) {
gd->env_valid = ENV_VALID;
@@ -172,7 +172,7 @@ int env_import_redund(const char *buf1, int buf1_read_fail,
tmp_env2->crc;
if (!crc1_ok && !crc2_ok) {
- set_default_env("bad CRC", 0);
+ env_set_default("bad CRC", 0);
return -ENOMSG; /* needed for env_load() */
} else if (crc1_ok && !crc2_ok) {
gd->env_valid = ENV_VALID;
@@ -236,10 +236,10 @@ void env_relocate(void)
if (gd->env_valid == ENV_INVALID) {
#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_SPL_BUILD)
/* Environment not changable */
- set_default_env(NULL, 0);
+ env_set_default(NULL, 0);
#else
bootstage_error(BOOTSTAGE_ID_NET_CHECKSUM);
- set_default_env("bad CRC", 0);
+ env_set_default("bad CRC", 0);
#endif
} else {
env_load();