]> git.baikalelectronics.ru Git - uboot.git/commitdiff
env: Update env_addr for mmc environment driver
authorPankit Garg <pankit.garg@nxp.com>
Tue, 19 Nov 2019 09:49:31 +0000 (09:49 +0000)
committerJoe Hershberger <joe.hershberger@ni.com>
Mon, 9 Mar 2020 23:11:24 +0000 (18:11 -0500)
Make sure the gd struct is up-to-date.

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
env/mmc.c

index b24c35cec94e24f200516656972fa7dac7eb3337..251ad07d7c08f2a309667e986c5a662008c3666f 100644 (file)
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -353,6 +353,7 @@ static int env_mmc_load(void)
        int ret;
        int dev = mmc_get_env_dev();
        const char *errmsg;
+       env_t *ep = NULL;
 
        mmc = find_mmc_device(dev);
 
@@ -374,6 +375,10 @@ static int env_mmc_load(void)
        }
 
        ret = env_import(buf, 1);
+       if (!ret) {
+               ep = (env_t *)buf;
+               gd->env_addr = (ulong)&ep->data;
+       }
 
 fini:
        fini_mmc_for_env(mmc);