summaryrefslogtreecommitdiff
path: root/env/ext4.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-07-28 11:51:15 +0200
committerTom Rini <trini@konsulko.com>2020-07-31 10:13:00 -0400
commit286fee5062ed31bd0373d3fc43ebe22d85bca4ae (patch)
tree39fe233961357430d3422965c019ee88fe2f8698 /env/ext4.c
parent87dac740122304dd196d090ab38edd1299130880 (diff)
downloadu-boot-286fee5062ed31bd0373d3fc43ebe22d85bca4ae.tar.gz
u-boot-286fee5062ed31bd0373d3fc43ebe22d85bca4ae.tar.bz2
u-boot-286fee5062ed31bd0373d3fc43ebe22d85bca4ae.zip
env: ext4: set gd->env_valid
Add a missing initialization of gd->env_valid in env_ext4_load as it is already done in some other env device. Set gd->env_valid = ENV_VALID in env_ext4_save() and env_ext4_load(). This patch allows to have a correct information in 'env info' command. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'env/ext4.c')
-rw-r--r--env/ext4.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/env/ext4.c b/env/ext4.c
index 8e90bb71b7..ac9f126bec 100644
--- a/env/ext4.c
+++ b/env/ext4.c
@@ -32,6 +32,8 @@
#include <ext4fs.h>
#include <mmc.h>
+DECLARE_GLOBAL_DATA_PTR;
+
__weak const char *env_ext4_get_intf(void)
{
return (const char *)CONFIG_ENV_EXT4_INTERFACE;
@@ -79,6 +81,7 @@ static int env_ext4_save(void)
CONFIG_ENV_EXT4_FILE, ifname, dev, part);
return 1;
}
+ gd->env_valid = ENV_VALID;
puts("done\n");
return 0;
@@ -124,7 +127,11 @@ static int env_ext4_load(void)
goto err_env_relocate;
}
- return env_import(buf, 1);
+ err = env_import(buf, 1);
+ if (!err)
+ gd->env_valid = ENV_VALID;
+
+ return err;
err_env_relocate:
env_set_default(NULL, 0);