From 382bee57f19b4454e2015bc19a010bc2d0ab9337 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Aug 2017 12:22:09 -0600 Subject: 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 Signed-off-by: Simon Glass --- board/siemens/common/factoryset.c | 6 +++--- board/siemens/common/factoryset.h | 2 +- board/siemens/draco/board.c | 8 ++++---- board/siemens/pxm2/board.c | 4 ++-- board/siemens/rut/board.c | 4 ++-- board/siemens/taurus/taurus.c | 24 ++++++++++++------------ 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'board/siemens') diff --git a/board/siemens/common/factoryset.c b/board/siemens/common/factoryset.c index 6c869ed2b03..4e5ad58d44c 100644 --- a/board/siemens/common/factoryset.c +++ b/board/siemens/common/factoryset.c @@ -266,7 +266,7 @@ err: static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; -static int factoryset_mac_setenv(void) +static int factoryset_mac_env_set(void) { uint8_t mac_addr[6]; @@ -296,11 +296,11 @@ static int factoryset_mac_setenv(void) return 0; } -int factoryset_setenv(void) +int factoryset_env_set(void) { int ret = 0; - if (factoryset_mac_setenv() < 0) + if (factoryset_mac_env_set() < 0) ret = -1; return ret; diff --git a/board/siemens/common/factoryset.h b/board/siemens/common/factoryset.h index 3f23d5ebf41..8602627d2e1 100644 --- a/board/siemens/common/factoryset.h +++ b/board/siemens/common/factoryset.h @@ -25,7 +25,7 @@ struct factorysetcontainer { }; int factoryset_read_eeprom(int i2c_addr); -int factoryset_setenv(void); +int factoryset_env_set(void); extern struct factorysetcontainer factory_dat; #endif /* __FACTORYSET_H */ diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c index d8869a09dd0..c705b5ab0f6 100644 --- a/board/siemens/draco/board.c +++ b/board/siemens/draco/board.c @@ -272,13 +272,13 @@ int board_late_init(void) #ifdef CONFIG_FACTORYSET /* Set ASN in environment*/ if (factory_dat.asn[0] != 0) { - setenv("dtb_name", (char *)factory_dat.asn); + env_set("dtb_name", (char *)factory_dat.asn); } else { /* dtb suffix gets added in load script */ - setenv("dtb_name", "am335x-draco"); + env_set("dtb_name", "am335x-draco"); } #else - setenv("dtb_name", "am335x-draco"); + env_set("dtb_name", "am335x-draco"); #endif return 0; @@ -330,7 +330,7 @@ int board_eth_init(bd_t *bis) int n = 0; int rv; - factoryset_setenv(); + factoryset_env_set(); /* Set rgmii mode and enable rmii clock to be sourced from chip */ writel((RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE), &cdev->miisel); diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c index 750f3388974..012974d8ebd 100644 --- a/board/siemens/pxm2/board.c +++ b/board/siemens/pxm2/board.c @@ -446,12 +446,12 @@ int board_late_init(void) factory_dat.pxm50 = 0; sprintf(tmp, "%s_%s", factory_dat.asn, factory_dat.comp_version); - ret = setenv("boardid", tmp); + ret = env_set("boardid", tmp); if (ret) printf("error setting board id\n"); } else { factory_dat.pxm50 = 1; - ret = setenv("boardid", "PXM50_1.0"); + ret = env_set("boardid", "PXM50_1.0"); if (ret) printf("error setting board id\n"); } diff --git a/board/siemens/rut/board.c b/board/siemens/rut/board.c index b3c666c054f..2a97414bafa 100644 --- a/board/siemens/rut/board.c +++ b/board/siemens/rut/board.c @@ -182,7 +182,7 @@ int board_eth_init(bd_t *bis) int rv; #ifndef CONFIG_SPL_BUILD - factoryset_setenv(); + factoryset_env_set(); #endif /* Set rgmii mode and enable rmii clock to be sourced from chip */ @@ -482,7 +482,7 @@ int board_late_init(void) else strcpy(tmp, "QMX7.E38_4.0"); - ret = setenv("boardid", tmp); + ret = env_set("boardid", tmp); if (ret) printf("error setting board id\n"); diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index 3b742ebc224..d877a9c7714 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -380,9 +380,9 @@ static int upgrade_failure_fallback(void) partitionset_active = getenv("partitionset_active"); if (partitionset_active) { if (partitionset_active[0] == 'A') - setenv("partitionset_active", "B"); + env_set("partitionset_active", "B"); else - setenv("partitionset_active", "A"); + env_set("partitionset_active", "A"); } else { printf("partitionset_active missing.\n"); return -ENOENT; @@ -390,22 +390,22 @@ static int upgrade_failure_fallback(void) rootfs = getenv("rootfs"); rootfs_fallback = getenv("rootfs_fallback"); - setenv("rootfs", rootfs_fallback); - setenv("rootfs_fallback", rootfs); + env_set("rootfs", rootfs_fallback); + env_set("rootfs_fallback", rootfs); kern_size = getenv("kernel_size"); kern_size_fb = getenv("kernel_size_fallback"); - setenv("kernel_size", kern_size_fb); - setenv("kernel_size_fallback", kern_size); + env_set("kernel_size", kern_size_fb); + env_set("kernel_size_fallback", kern_size); kern_off = getenv("kernel_Off"); kern_off_fb = getenv("kernel_Off_fallback"); - setenv("kernel_Off", kern_off_fb); - setenv("kernel_Off_fallback", kern_off); + env_set("kernel_Off", kern_off_fb); + env_set("kernel_Off_fallback", kern_off); - setenv("bootargs", '\0'); - setenv("upgrade_available", '\0'); - setenv("boot_retries", '\0'); + env_set("bootargs", '\0'); + env_set("upgrade_available", '\0'); + env_set("boot_retries", '\0'); env_save(); return 0; @@ -424,7 +424,7 @@ static int do_upgrade_available(cmd_tbl_t *cmdtp, int flag, int argc, boot_retry = simple_strtoul(getenv("boot_retries"), NULL, 10); boot_retry++; sprintf(boot_buf, "%lx", boot_retry); - setenv("boot_retries", boot_buf); + env_set("boot_retries", boot_buf); env_save(); /* -- cgit v1.2.3