[U-Boot] env: Update env_addr for mmc environment driver
diff mbox series

Message ID 20191119094545.16014-1-pankit.garg@nxp.com
State New
Delegated to: Joe Hershberger
Headers show
Series
  • [U-Boot] env: Update env_addr for mmc environment driver
Related show

Commit Message

Pankit Garg Nov. 19, 2019, 9:49 a.m. UTC
Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
---
 env/mmc.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Joe Hershberger Nov. 20, 2019, 12:28 a.m. UTC | #1
On Tue, Nov 19, 2019 at 5:44 AM Pankit Garg <pankit.garg@nxp.com> wrote:
>
> Signed-off-by: Pankit Garg <pankit.garg@nxp.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Priyanka Jain Nov. 20, 2019, 5:58 a.m. UTC | #2
>-----Original Message-----
>From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Pankit Garg
>Sent: Tuesday, November 19, 2019 3:20 PM
>To: u-boot@lists.denx.de
>Cc: Pankit Garg <pankit.garg@nxp.com>
>Subject: [U-Boot] [PATCH] env: Update env_addr for mmc environment driver
>
Please add description
>Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
>---
> env/mmc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/env/mmc.c b/env/mmc.c
>index 9f1878def1..832e11cde6 100644
>--- a/env/mmc.c
>+++ b/env/mmc.c
>@@ -362,6 +362,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);
>
>@@ -383,6 +384,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);
>--
>2.17.1
>
-priyankajain

Patch
diff mbox series

diff --git a/env/mmc.c b/env/mmc.c
index 9f1878def1..832e11cde6 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -362,6 +362,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);
 
@@ -383,6 +384,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);