From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Delaunay Date: Tue, 28 Jul 2020 11:51:15 +0200 Subject: [PATCH v4 02/14] env: ext4: set gd->env_valid In-Reply-To: <20200728095128.2363-1-patrick.delaunay@st.com> References: <20200728095128.2363-1-patrick.delaunay@st.com> Message-ID: <20200728095128.2363-3-patrick.delaunay@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Signed-off-by: Patrick Delaunay --- (no changes since v1) env/ext4.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 #include +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); -- 2.17.1