aboutsummaryrefslogtreecommitdiff
path: root/board/keymile
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-08-03 12:22:12 -0600
committerTom Rini <trini@konsulko.com>2017-08-16 08:30:24 -0400
commit00caae6d47645e68d6e5277aceb69592b49381a6 (patch)
treec361aa0cea3093b93c1118266fe9e2b44ac6e453 /board/keymile
parentfd1e959e91d2b0b2e853d09dd9167dfff18a616c (diff)
downloadu-boot-00caae6d47645e68d6e5277aceb69592b49381a6.zip
u-boot-00caae6d47645e68d6e5277aceb69592b49381a6.tar.gz
u-boot-00caae6d47645e68d6e5277aceb69592b49381a6.tar.bz2
env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board/keymile')
-rw-r--r--board/keymile/common/common.c10
-rw-r--r--board/keymile/common/ivm.c2
-rw-r--r--board/keymile/km_arm/km_arm.c2
-rw-r--r--board/keymile/kmp204x/kmp204x.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index 56d3044..6cd2812 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -54,7 +54,7 @@ int set_km_env(void)
env_set("pnvramaddr", (char *)buf);
/* try to read rootfssize (ram image) from environment */
- p = getenv("rootfssize");
+ p = env_get("rootfssize");
if (p != NULL)
strict_strtoul(p, 16, &rootfssize);
pram = (rootfssize + CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM +
@@ -236,10 +236,10 @@ static int do_checkboardidhwk(cmd_tbl_t *cmdtp, int flag, int argc,
}
/* now try to read values from environment if available */
- p = getenv("boardid");
+ p = env_get("boardid");
if (p != NULL)
rc = strict_strtoul(p, 16, &envbid);
- p = getenv("hwkey");
+ p = env_get("hwkey");
if (p != NULL)
rc = strict_strtoul(p, 16, &envhwkey);
@@ -253,7 +253,7 @@ static int do_checkboardidhwk(cmd_tbl_t *cmdtp, int flag, int argc,
* BoardId/HWkey not available in the environment, so try the
* environment variable for BoardId/HWkey list
*/
- char *bidhwklist = getenv("boardIdListHex");
+ char *bidhwklist = env_get("boardIdListHex");
if (bidhwklist) {
int found = 0;
@@ -355,7 +355,7 @@ static int do_checktestboot(cmd_tbl_t *cmdtp, int flag, int argc,
#if defined(CONFIG_POST)
testpin = post_hotkeys_pressed();
#endif
- s = getenv("test_bank");
+ s = env_get("test_bank");
/* when test_bank is not set, act as if testpin is not asserted */
testboot = (testpin != 0) && (s);
if (verbose) {
diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index dc40a83..f1321d9 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -261,7 +261,7 @@ int ivm_analyze_eeprom(unsigned char *buf, int len)
GET_STRING("IVM_Symbol", IVM_POS_SYMBOL_ONLY, 8)
GET_STRING("IVM_DeviceName", IVM_POS_SHORT_TEXT, 64)
- tmp = (unsigned char *) getenv("IVM_DeviceName");
+ tmp = (unsigned char *)env_get("IVM_DeviceName");
if (tmp) {
int len = strlen((char *)tmp);
int i = 0;
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 08ae9ae..af1ebc4 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -201,7 +201,7 @@ int misc_init_r(void)
#if defined(CONFIG_KM_MGCOGE3UN)
char *wait_for_ne;
u8 dip_switch = kw_gpio_get_value(KM_FLASH_ERASE_ENABLE);
- wait_for_ne = getenv("waitforne");
+ wait_for_ne = env_get("waitforne");
if ((wait_for_ne != NULL) && (dip_switch == 0)) {
if (strcmp(wait_for_ne, "true") == 0) {
diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index 095e467..671bddf 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -239,7 +239,7 @@ void fdt_fixup_fman_mac_addresses(void *blob)
unsigned char mac_addr[6];
/* get the mac addr from env */
- tmp = getenv("ethaddr");
+ tmp = env_get("ethaddr");
if (!tmp) {
printf("ethaddr env variable not defined\n");
return;