diff mbox series

[08/11] env: add env_driver parameter to env_import_redund

Message ID 653352d39996fef8dd4947c423ab33b0abae1765.1513975247.git-series.quentin.schulz@free-electrons.com
State New
Headers show
Series Introduce variables whitelisting in environment | expand

Commit Message

Quentin Schulz Dec. 22, 2017, 9:13 p.m. UTC
To prepare for an upcoming patch that uses the location of the driver
used when doing an env_import_redund, add env_driver as an argument of
env_import_redund so that it can be used within.

Update all calls to this function and the prototype.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
---
 env/common.c          | 2 +-
 env/nand.c            | 2 +-
 env/ubi.c             | 2 +-
 include/environment.h | 3 ++-
 4 files changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/env/common.c b/env/common.c
index 75b8334..24cf41b 100644
--- a/env/common.c
+++ b/env/common.c
@@ -197,7 +197,7 @@  int env_import(const char *buf, int check)
 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
 static unsigned char env_flags;
 
-int env_import_redund(const char *buf1, const char *buf2)
+int env_import_redund(struct env_driver *drv, const char *buf1, const char *buf2)
 {
 	int crc1_ok, crc2_ok;
 	env_t *ep, *tmp_env1, *tmp_env2;
diff --git a/env/nand.c b/env/nand.c
index 6ed3c26..49e506e 100644
--- a/env/nand.c
+++ b/env/nand.c
@@ -352,7 +352,7 @@  static int env_nand_load(struct env_driver *drv)
 		gd->env_valid = ENV_REDUND;
 		env_import((char *)tmp_env2, 1);
 	} else {
-		env_import_redund((char *)tmp_env1, (char *)tmp_env2);
+		env_import_redund(drv, (char *)tmp_env1, (char *)tmp_env2);
 	}
 
 done:
diff --git a/env/ubi.c b/env/ubi.c
index a649999..51b61eb 100644
--- a/env/ubi.c
+++ b/env/ubi.c
@@ -130,7 +130,7 @@  static int env_ubi_load(struct env_driver *drv)
 		       CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME_REDUND);
 	}
 
-	env_import_redund((char *)tmp_env1, (char *)tmp_env2);
+	env_import_redund(drv, (char *)tmp_env1, (char *)tmp_env2);
 
 	return 0;
 }
diff --git a/include/environment.h b/include/environment.h
index 34a0d5e..1e9254f 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -318,7 +318,8 @@  int env_export(env_t *env_out);
 
 #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
 /* Select and import one of two redundant environments */
-int env_import_redund(const char *buf1, const char *buf2);
+int env_import_redund(struct env_driver *drv, const char *buf1,
+		      const char *buf2);
 #endif
 
 /**