[U-Boot] [PATCH v5 14/19] fs: converted with new env interfaces

AKASHI Takahiro takahiro.akashi at linaro.org
Thu Sep 5 08:21:28 UTC 2019


env_xxx(...) -> env_xxx(ctx_uboot, ...)

Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
---
 fs/fs.c          | 14 +++++++-------
 fs/ubifs/ubifs.c |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index d8a4ced4698e..b26c94f89764 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -647,7 +647,7 @@ int do_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 	if (fs_size(argv[3], &size) < 0)
 		return CMD_RET_FAILURE;
 
-	env_set_hex("filesize", size);
+	env_set_hex(ctx_uboot, "filesize", size);
 
 	return 0;
 }
@@ -678,7 +678,7 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 		if (ep == argv[3] || *ep != '\0')
 			return CMD_RET_USAGE;
 	} else {
-		addr_str = env_get("loadaddr");
+		addr_str = env_get(ctx_uboot, "loadaddr");
 		if (addr_str != NULL)
 			addr = simple_strtoul(addr_str, NULL, 16);
 		else
@@ -687,7 +687,7 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 	if (argc >= 5) {
 		filename = argv[4];
 	} else {
-		filename = env_get("bootfile");
+		filename = env_get(ctx_uboot, "bootfile");
 		if (!filename) {
 			puts("** No boot file defined **\n");
 			return 1;
@@ -720,8 +720,8 @@ int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 	}
 	puts("\n");
 
-	env_set_hex("fileaddr", addr);
-	env_set_hex("filesize", len_read);
+	env_set_hex(ctx_uboot, "fileaddr", addr);
+	env_set_hex(ctx_uboot, "filesize", len_read);
 
 	return 0;
 }
@@ -812,7 +812,7 @@ int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 		return CMD_RET_FAILURE;
 
 	if (argc == 4)
-		env_set(argv[3], uuid);
+		env_set(ctx_uboot, argv[3], uuid);
 	else
 		printf("%s\n", uuid);
 
@@ -832,7 +832,7 @@ int do_fs_type(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	info = fs_get_info(fs_type);
 
 	if (argc == 4)
-		env_set(argv[3], info->name);
+		env_set(ctx_uboot, argv[3], info->name);
 	else
 		printf("%s\n", info->name);
 
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 67a0e8caae70..7b16b16e068f 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -944,7 +944,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
 
 	err = ubifs_read(filename, (void *)(uintptr_t)addr, 0, size, &actread);
 	if (err == 0) {
-		env_set_hex("filesize", actread);
+		env_set_hex(ctx_uboot, "filesize", actread);
 		printf("Done\n");
 	}
 
-- 
2.21.0



More information about the U-Boot mailing list