summaryrefslogtreecommitdiff
path: root/cmd/mtdparts.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-03 12:22:09 -0600
committerTom Rini <trini@konsulko.com>2017-08-16 08:22:18 -0400
commit382bee57f19b4454e2015bc19a010bc2d0ab9337 (patch)
tree8c13efda2a6539cdbf1ac76fc458ffef1e9c966d /cmd/mtdparts.c
parent01510091de905c46620757b9027b2e55c4b3b313 (diff)
env: Rename setenv() to env_set()
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/mtdparts.c')
-rw-r--r--cmd/mtdparts.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index 683c48bdad..a2433503c4 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -246,12 +246,12 @@ static void index_partitions(void)
}
part = mtd_part_info(current_mtd_dev, current_mtd_partnum);
- setenv("mtddevname", part->name);
+ env_set("mtddevname", part->name);
debug("=> mtddevnum %d,\n=> mtddevname %s\n", mtddevnum, part->name);
} else {
- setenv("mtddevnum", NULL);
- setenv("mtddevname", NULL);
+ env_set("mtddevnum", NULL);
+ env_set("mtddevname", NULL);
debug("=> mtddevnum NULL\n=> mtddevname NULL\n");
}
@@ -270,12 +270,12 @@ static void current_save(void)
sprintf(buf, "%s%d,%d", MTD_DEV_TYPE(current_mtd_dev->id->type),
current_mtd_dev->id->num, current_mtd_partnum);
- setenv("partition", buf);
+ env_set("partition", buf);
strncpy(last_partition, buf, 16);
debug("=> partition %s\n", buf);
} else {
- setenv("partition", NULL);
+ env_set("partition", NULL);
last_partition[0] = '\0';
debug("=> partition NULL\n");
@@ -1213,9 +1213,9 @@ static int generate_mtdparts_save(char *buf, u32 buflen)
ret = generate_mtdparts(buf, buflen);
if ((buf[0] != '\0') && (ret == 0))
- setenv("mtdparts", buf);
+ env_set("mtdparts", buf);
else
- setenv("mtdparts", NULL);
+ env_set("mtdparts", NULL);
return ret;
}
@@ -1764,7 +1764,7 @@ int mtdparts_init(void)
if (mtdids_default) {
debug("mtdids variable not defined, using default\n");
ids = mtdids_default;
- setenv("mtdids", (char *)ids);
+ env_set("mtdids", (char *)ids);
} else {
printf("mtdids not defined, no default present\n");
return 1;
@@ -1780,7 +1780,7 @@ int mtdparts_init(void)
if (!parts) {
if (mtdparts_default && use_defaults) {
parts = mtdparts_default;
- if (setenv("mtdparts", (char *)parts) == 0)
+ if (env_set("mtdparts", (char *)parts) == 0)
use_defaults = 0;
} else
printf("mtdparts variable not set, see 'help mtdparts'\n");
@@ -1956,9 +1956,9 @@ static int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc,
{
if (argc == 2) {
if (strcmp(argv[1], "default") == 0) {
- setenv("mtdids", NULL);
- setenv("mtdparts", NULL);
- setenv("partition", NULL);
+ env_set("mtdids", NULL);
+ env_set("mtdparts", NULL);
+ env_set("partition", NULL);
use_defaults = 1;
mtdparts_init();
@@ -1967,7 +1967,7 @@ static int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc,
/* this may be the first run, initialize lists if needed */
mtdparts_init();
- setenv("mtdparts", NULL);
+ env_set("mtdparts", NULL);
/* mtd_devices_init() calls current_save() */
return mtd_devices_init();