From: Pankit Garg Date: Tue, 19 Nov 2019 09:49:31 +0000 (+0000) Subject: env: Update env_addr for mmc environment driver X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-logo.png?a=commitdiff_plain;h=0536b440a8f1618f666f2f0e1663d549b4833c24;p=u-boot.git env: Update env_addr for mmc environment driver Make sure the gd struct is up-to-date. Signed-off-by: Pankit Garg Acked-by: Joe Hershberger --- diff --git a/env/mmc.c b/env/mmc.c index b24c35cec9..251ad07d7c 100644 --- 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);