summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/autoboot.c16
-rw-r--r--common/bootm.c4
-rw-r--r--common/bootm_os.c10
-rw-r--r--common/bootretry.c2
-rw-r--r--common/cli.c2
-rw-r--r--common/cli_hush.c14
-rw-r--r--common/cli_simple.c4
-rw-r--r--common/console.c10
-rw-r--r--common/fb_mmc.c2
-rw-r--r--common/fdt_support.c6
-rw-r--r--common/hash.c2
-rw-r--r--common/hwconfig.c2
-rw-r--r--common/image-android.c2
-rw-r--r--common/image-fdt.c2
-rw-r--r--common/image.c14
-rw-r--r--common/lcd.c2
-rw-r--r--common/main.c2
-rw-r--r--common/spl/Kconfig2
-rw-r--r--common/spl/spl_dfu.c2
-rw-r--r--common/spl/spl_ext.c4
-rw-r--r--common/spl/spl_fat.c4
-rw-r--r--common/splash.c2
-rw-r--r--common/splash_source.c6
-rw-r--r--common/update.c7
-rw-r--r--common/usb_hub.c2
-rw-r--r--common/usb_kbd.c6
26 files changed, 67 insertions, 64 deletions
diff --git a/common/autoboot.c b/common/autoboot.c
index 41f18208c3..35c1e972c6 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -50,7 +50,7 @@ static int slow_equals(u8 *a, u8 *b, int len)
static int passwd_abort(uint64_t etime)
{
- const char *sha_env_str = getenv("bootstopkeysha256");
+ const char *sha_env_str = env_get("bootstopkeysha256");
u8 sha_env[SHA256_SUM_LEN];
u8 sha[SHA256_SUM_LEN];
char presskey[MAX_DELAY_STOP_STR];
@@ -109,8 +109,8 @@ static int passwd_abort(uint64_t etime)
int retry;
}
delaykey[] = {
- { .str = getenv("bootdelaykey"), .retry = 1 },
- { .str = getenv("bootstopkey"), .retry = 0 },
+ { .str = env_get("bootdelaykey"), .retry = 1 },
+ { .str = env_get("bootstopkey"), .retry = 0 },
};
char presskey[MAX_DELAY_STOP_STR];
@@ -304,7 +304,7 @@ const char *bootdelay_process(void)
bootlimit = getenv_ulong("bootlimit", 10, 0);
#endif /* CONFIG_BOOTCOUNT_LIMIT */
- s = getenv("bootdelay");
+ s = env_get("bootdelay");
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
#ifdef CONFIG_OF_CONTROL
@@ -321,17 +321,17 @@ const char *bootdelay_process(void)
#ifdef CONFIG_POST
if (gd->flags & GD_FLG_POSTFAIL) {
- s = getenv("failbootcmd");
+ s = env_get("failbootcmd");
} else
#endif /* CONFIG_POST */
#ifdef CONFIG_BOOTCOUNT_LIMIT
if (bootlimit && (bootcount > bootlimit)) {
printf("Warning: Bootlimit (%u) exceeded. Using altbootcmd.\n",
(unsigned)bootlimit);
- s = getenv("altbootcmd");
+ s = env_get("altbootcmd");
} else
#endif /* CONFIG_BOOTCOUNT_LIMIT */
- s = getenv("bootcmd");
+ s = env_get("bootcmd");
process_fdt_options(gd->fdt_blob);
stored_bootdelay = bootdelay;
@@ -357,7 +357,7 @@ void autoboot_command(const char *s)
#ifdef CONFIG_MENUKEY
if (menukey == CONFIG_MENUKEY) {
- s = getenv("menucmd");
+ s = env_get("menucmd");
if (s)
run_command_list(s, -1, 0);
}
diff --git a/common/bootm.c b/common/bootm.c
index e34617a145..0c380e742f 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -524,7 +524,7 @@ static void fixup_silent_linux(void)
{
char *buf;
const char *env_val;
- char *cmdline = getenv("bootargs");
+ char *cmdline = env_get("bootargs");
int want_silent;
/*
@@ -691,7 +691,7 @@ int do_bootm_states(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
#ifdef CONFIG_TRACE
/* Pretend to run the OS, then run a user command */
if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) {
- char *cmd_list = getenv("fakegocmd");
+ char *cmd_list = env_get("fakegocmd");
ret = boot_selected_os(argc, argv, BOOTM_STATE_OS_FAKE_GO,
images, boot_fn);
diff --git a/common/bootm_os.c b/common/bootm_os.c
index 86a37cb925..1feea8af17 100644
--- a/common/bootm_os.c
+++ b/common/bootm_os.c
@@ -21,7 +21,7 @@ static int do_bootm_standalone(int flag, int argc, char * const argv[],
int (*appl)(int, char *const[]);
/* Don't start if "autostart" is set to "no" */
- s = getenv("autostart");
+ s = env_get("autostart");
if ((s != NULL) && !strcmp(s, "no")) {
env_set_hex("filesize", images->os.image_len);
return 0;
@@ -96,7 +96,7 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[],
cmdline = malloc(len);
copy_args(cmdline, argc, argv, ' ');
} else {
- cmdline = getenv("bootargs");
+ cmdline = env_get("bootargs");
if (cmdline == NULL)
cmdline = "";
}
@@ -227,14 +227,14 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[],
#endif
/* See README.plan9 */
- s = getenv("confaddr");
+ s = env_get("confaddr");
if (s != NULL) {
char *confaddr = (char *)simple_strtoul(s, NULL, 16);
if (argc > 0) {
copy_args(confaddr, argc, argv, '\n');
} else {
- s = getenv("bootargs");
+ s = env_get("bootargs");
if (s != NULL)
strcpy(confaddr, s);
}
@@ -278,7 +278,7 @@ void do_bootvx_fdt(bootm_headers_t *images)
ret = fdt_add_subnode(*of_flat_tree, 0, "chosen");
if ((ret >= 0 || ret == -FDT_ERR_EXISTS)) {
- bootline = getenv("bootargs");
+ bootline = env_get("bootargs");
if (bootline) {
ret = fdt_find_and_setprop(*of_flat_tree,
"/chosen", "bootargs",
diff --git a/common/bootretry.c b/common/bootretry.c
index 2d82798cd0..b3b8271a92 100644
--- a/common/bootretry.c
+++ b/common/bootretry.c
@@ -23,7 +23,7 @@ static int retry_time = -1; /* -1 so can call readline before main_loop */
*/
void bootretry_init_cmd_timeout(void)
{
- char *s = getenv("bootretry");
+ char *s = env_get("bootretry");
if (s != NULL)
retry_time = (int)simple_strtol(s, NULL, 10);
diff --git a/common/cli.c b/common/cli.c
index a433ef2166..57874d8797 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -129,7 +129,7 @@ int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
for (i = 1; i < argc; ++i) {
char *arg;
- arg = getenv(argv[i]);
+ arg = env_get(argv[i]);
if (arg == NULL) {
printf("## Error: \"%s\" not defined\n", argv[i]);
return 1;
diff --git a/common/cli_hush.c b/common/cli_hush.c
index 280289639c..07c048ec6a 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -560,7 +560,7 @@ static int builtin_cd(struct child_prog *child)
{
char *newdir;
if (child->argv[1] == NULL)
- newdir = getenv("HOME");
+ newdir = env_get("HOME");
else
newdir = child->argv[1];
if (chdir(newdir)) {
@@ -948,7 +948,7 @@ static inline void cmdedit_set_initial_prompt(void)
#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
PS1 = NULL;
#else
- PS1 = getenv("PS1");
+ PS1 = env_get("PS1");
if(PS1==0)
PS1 = "\\w \\$ ";
#endif
@@ -987,9 +987,9 @@ static int uboot_cli_readline(struct in_str *i)
#ifdef CONFIG_CMDLINE_PS_SUPPORT
if (i->promptmode == 1)
- ps_prompt = getenv("PS1");
+ ps_prompt = env_get("PS1");
else
- ps_prompt = getenv("PS2");
+ ps_prompt = env_get("PS2");
if (ps_prompt)
prompt = ps_prompt;
#endif
@@ -2172,7 +2172,7 @@ int set_local_var(const char *s, int flg_export)
name=strdup(s);
#ifdef __U_BOOT__
- if (getenv(name) != NULL) {
+ if (env_get(name) != NULL) {
printf ("ERROR: "
"There is a global environment variable with the same name.\n");
free(name);
@@ -2793,7 +2793,7 @@ static char *lookup_param(char *src)
}
}
- p = getenv(src);
+ p = env_get(src);
if (!p)
p = get_local_var(src);
@@ -3157,7 +3157,7 @@ static void mapset(const unsigned char *set, int code)
static void update_ifs_map(void)
{
/* char *ifs and char map[256] are both globals. */
- ifs = (uchar *)getenv("IFS");
+ ifs = (uchar *)env_get("IFS");
if (ifs == NULL) ifs=(uchar *)" \t\n";
/* Precompute a list of 'flow through' behavior so it can be treated
* quickly up front. Computation is necessary because of IFS.
diff --git a/common/cli_simple.c b/common/cli_simple.c
index bb96aaead6..cb642d2ff3 100644
--- a/common/cli_simple.c
+++ b/common/cli_simple.c
@@ -131,7 +131,7 @@ void cli_simple_process_macros(const char *input, char *output)
envname[i] = 0;
/* Get its value */
- envval = getenv(envname);
+ envval = env_get(envname);
/* Copy into the line if it exists */
if (envval != NULL)
@@ -168,7 +168,7 @@ void cli_simple_process_macros(const char *input, char *output)
* WARNING:
*
* We must create a temporary copy of the command since the command we get
- * may be the result from getenv(), which returns a pointer directly to
+ * may be the result from env_get(), which returns a pointer directly to
* the environment data, which may change magicly when the command we run
* creates or modifies environment variables (like "bootp" does).
*/
diff --git a/common/console.c b/common/console.c
index 3f7ca2baa7..3167921ec9 100644
--- a/common/console.c
+++ b/common/console.c
@@ -666,7 +666,7 @@ int console_assign(int file, const char *devname)
static void console_update_silent(void)
{
#ifdef CONFIG_SILENT_CONSOLE
- if (getenv("silent") != NULL)
+ if (env_get("silent") != NULL)
gd->flags |= GD_FLG_SILENT;
else
gd->flags &= ~GD_FLG_SILENT;
@@ -745,9 +745,9 @@ int console_init_r(void)
/* stdin stdout and stderr are in environment */
/* scan for it */
- stdinname = getenv("stdin");
- stdoutname = getenv("stdout");
- stderrname = getenv("stderr");
+ stdinname = env_get("stdin");
+ stdoutname = env_get("stdout");
+ stderrname = env_get("stderr");
if (OVERWRITE_CONSOLE == 0) { /* if not overwritten by config switch */
inputdev = search_device(DEV_FLAGS_INPUT, stdinname);
@@ -836,7 +836,7 @@ int console_init_r(void)
* console to serial console in this case or suppress it if
* "silent" mode was requested.
*/
- if (getenv("splashimage") != NULL) {
+ if (env_get("splashimage") != NULL) {
if (!(gd->flags & GD_FLG_SILENT))
outputdev = search_device (DEV_FLAGS_OUTPUT, "serial");
}
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 2113b6c372..5065ad5f73 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -49,7 +49,7 @@ static int part_get_info_by_name_or_alias(struct blk_desc *dev_desc,
/* check for alias */
strcpy(env_alias_name, "fastboot_partition_alias_");
strncat(env_alias_name, name, 32);
- aliased_part_name = getenv(env_alias_name);
+ aliased_part_name = env_get(env_alias_name);
if (aliased_part_name != NULL)
ret = part_get_info_by_name(dev_desc,
aliased_part_name, info);
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 7ccf8b19fd..916a448c11 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -197,7 +197,7 @@ int fdt_root(void *fdt)
return err;
}
- serial = getenv("serial#");
+ serial = env_get("serial#");
if (serial) {
err = fdt_setprop(fdt, 0, "serial-number", serial,
strlen(serial) + 1);
@@ -289,7 +289,7 @@ int fdt_chosen(void *fdt)
if (nodeoffset < 0)
return nodeoffset;
- str = getenv("bootargs");
+ str = env_get("bootargs");
if (str) {
err = fdt_setprop(fdt, nodeoffset, "bootargs", str,
strlen(str) + 1);
@@ -509,7 +509,7 @@ void fdt_fixup_ethernet(void *fdt)
} else {
continue;
}
- tmp = getenv(mac);
+ tmp = env_get(mac);
if (!tmp)
continue;
diff --git a/common/hash.c b/common/hash.c
index fda636d34a..dcf016d8a7 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -362,7 +362,7 @@ static int parse_verify_sum(struct hash_algo *algo, char *verify_str,
if (strlen(verify_str) == digits)
vsum_str = verify_str;
else {
- vsum_str = getenv(verify_str);
+ vsum_str = env_get(verify_str);
if (vsum_str == NULL || strlen(vsum_str) != digits) {
printf("Expected %d hex digits in env var\n",
digits);
diff --git a/common/hwconfig.c b/common/hwconfig.c
index 85aaabbb85..e5186d7796 100644
--- a/common/hwconfig.c
+++ b/common/hwconfig.c
@@ -81,7 +81,7 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
"and before environment is ready\n");
return NULL;
}
- env_hwconfig = getenv("hwconfig");
+ env_hwconfig = env_get("hwconfig");
}
if (env_hwconfig) {
diff --git a/common/image-android.c b/common/image-android.c
index 018c7594fe..e74d0aafca 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -72,7 +72,7 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
len += strlen(hdr->cmdline);
}
- char *bootargs = getenv("bootargs");
+ char *bootargs = env_get("bootargs");
if (bootargs)
len += strlen(bootargs);
diff --git a/common/image-fdt.c b/common/image-fdt.c
index c6e8832d66..2c499467c3 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -132,7 +132,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
of_len = *of_size + CONFIG_SYS_FDT_PAD;
/* If fdt_high is set use it to select the relocation address */
- fdt_high = getenv("fdt_high");
+ fdt_high = env_get("fdt_high");
if (fdt_high) {
void *desired_addr = (void *)simple_strtoul(fdt_high, NULL, 16);
diff --git a/common/image.c b/common/image.c
index 0f88984f2d..98c0eaa4c7 100644
--- a/common/image.c
+++ b/common/image.c
@@ -467,7 +467,7 @@ U_BOOT_ENV_CALLBACK(loadaddr, on_loadaddr);
ulong getenv_bootm_low(void)
{
- char *s = getenv("bootm_low");
+ char *s = env_get("bootm_low");
if (s) {
ulong tmp = simple_strtoul(s, NULL, 16);
return tmp;
@@ -486,7 +486,7 @@ phys_size_t getenv_bootm_size(void)
{
phys_size_t tmp, size;
phys_addr_t start;
- char *s = getenv("bootm_size");
+ char *s = env_get("bootm_size");
if (s) {
tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
return tmp;
@@ -500,7 +500,7 @@ phys_size_t getenv_bootm_size(void)
size = gd->bd->bi_memsize;
#endif
- s = getenv("bootm_low");
+ s = env_get("bootm_low");
if (s)
tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
else
@@ -512,7 +512,7 @@ phys_size_t getenv_bootm_size(void)
phys_size_t getenv_bootm_mapsize(void)
{
phys_size_t tmp;
- char *s = getenv("bootm_mapsize");
+ char *s = env_get("bootm_mapsize");
if (s) {
tmp = (phys_size_t)simple_strtoull(s, NULL, 16);
return tmp;
@@ -1224,7 +1224,8 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
ulong initrd_high;
int initrd_copy_to_ram = 1;
- if ((s = getenv("initrd_high")) != NULL) {
+ s = env_get("initrd_high");
+ if (s) {
/* a value of "no" or a similar string will act like 0,
* turning the "load high" feature off. This is intentional.
*/
@@ -1524,7 +1525,8 @@ int boot_get_cmdline(struct lmb *lmb, ulong *cmd_start, ulong *cmd_end)
if (cmdline == NULL)
return -1;
- if ((s = getenv("bootargs")) == NULL)
+ s = env_get("bootargs");
+ if (!s)
s = "";
strcpy(cmdline, s);
diff --git a/common/lcd.c b/common/lcd.c
index 7e399cee2d..c3ff9599ed 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -223,7 +223,7 @@ void lcd_clear(void)
/* Paint the logo and retrieve LCD base address */
debug("[LCD] Drawing the logo...\n");
if (do_splash) {
- s = getenv("splashimage");
+ s = env_get("splashimage");
if (s) {
do_splash = 0;
addr = simple_strtoul(s, NULL, 16);
diff --git a/common/main.c b/common/main.c
index 07fc31b716..6a1159879e 100644
--- a/common/main.c
+++ b/common/main.c
@@ -25,7 +25,7 @@ static void run_preboot_environment_command(void)
#ifdef CONFIG_PREBOOT
char *p;
- p = getenv("preboot");
+ p = env_get("preboot");
if (p != NULL) {
# ifdef CONFIG_AUTOBOOT_KEYED
int prev = disable_ctrlc(1); /* disable Control C checking */
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 3c887b3405..582b685dad 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -278,7 +278,7 @@ config SPL_ENV_SUPPORT
needed in SPL as it has a much simpler task with less
configuration. But some boards use this to support 'Falcon' boot
on EXT2 and FAT, where SPL boots directly into Linux without
- starting U-Boot first. Enabling this option will make getenv()
+ starting U-Boot first. Enabling this option will make env_get()
and env_set() available in SPL.
config SPL_SAVEENV
diff --git a/common/spl/spl_dfu.c b/common/spl/spl_dfu.c
index f5ec0fb396..2c974735b1 100644
--- a/common/spl/spl_dfu.c
+++ b/common/spl/spl_dfu.c
@@ -40,7 +40,7 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)
/* set default environment */
set_default_env(0);
- str_env = getenv(dfu_alt_info);
+ str_env = env_get(dfu_alt_info);
if (!str_env) {
error("\"dfu_alt_info\" env variable not defined!\n");
return -EINVAL;
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index f17c6b9494..559ba0b797 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -89,7 +89,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
return -1;
}
#if defined(CONFIG_SPL_ENV_SUPPORT)
- file = getenv("falcon_args_file");
+ file = env_get("falcon_args_file");
if (file) {
err = ext4fs_open(file, &filelen);
if (err < 0) {
@@ -102,7 +102,7 @@ int spl_load_image_ext_os(struct spl_image_info *spl_image,
file, err);
goto defaults;
}
- file = getenv("falcon_image_file");
+ file = env_get("falcon_image_file");
if (file) {
err = spl_load_image_ext(spl_image, block_dev,
partition, file);
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 5e312160d9..60b85f082d 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -113,7 +113,7 @@ int spl_load_image_fat_os(struct spl_image_info *spl_image,
return err;
#if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT)
- file = getenv("falcon_args_file");
+ file = env_get("falcon_args_file");
if (file) {
err = file_fat_read(file, (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
if (err <= 0) {
@@ -121,7 +121,7 @@ int spl_load_image_fat_os(struct spl_image_info *spl_image,
file, err);
goto defaults;
}
- file = getenv("falcon_image_file");
+ file = env_get("falcon_image_file");
if (file) {
err = spl_load_image_fat(spl_image, block_dev,
partition, file);
diff --git a/common/splash.c b/common/splash.c
index 89af437f2c..d251b3b654 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -60,7 +60,7 @@ __weak int splash_screen_prepare(void)
#ifdef CONFIG_SPLASH_SCREEN_ALIGN
void splash_get_pos(int *x, int *y)
{
- char *s = getenv("splashpos");
+ char *s = env_get("splashpos");
if (!s)
return;
diff --git a/common/splash_source.c b/common/splash_source.c
index 867a798487..8c0ac581f7 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -220,7 +220,7 @@ static int splash_load_fs(struct splash_location *location, u32 bmp_load_addr)
loff_t actread;
char *splash_file;
- splash_file = getenv("splashfile");
+ splash_file = env_get("splashfile");
if (!splash_file)
splash_file = SPLASH_SOURCE_DEFAULT_FILE_NAME;
@@ -286,7 +286,7 @@ static struct splash_location *select_splash_location(
if (!locations || size == 0)
return NULL;
- env_splashsource = getenv("splashsource");
+ env_splashsource = env_get("splashsource");
if (env_splashsource == NULL)
return &locations[0];
@@ -383,7 +383,7 @@ int splash_source_load(struct splash_location *locations, uint size)
char *env_splashimage_value;
u32 bmp_load_addr;
- env_splashimage_value = getenv("splashimage");
+ env_splashimage_value = env_get("splashimage");
if (env_splashimage_value == NULL)
return -ENOENT;
diff --git a/common/update.c b/common/update.c
index 061a5541b1..974f4655e7 100644
--- a/common/update.c
+++ b/common/update.c
@@ -59,7 +59,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr)
/* save used globals and env variable */
saved_timeout_msecs = tftp_timeout_ms;
saved_timeout_count = tftp_timeout_count_max;
- saved_netretry = strdup(getenv("netretry"));
+ saved_netretry = strdup(env_get("netretry"));
saved_bootfile = strdup(net_boot_file_name);
/* set timeouts for auto-update */
@@ -254,7 +254,7 @@ int update_tftp(ulong addr, char *interface, char *devstring)
printf("Auto-update from TFTP: ");
/* get the file name of the update file */
- filename = getenv(UPDATE_FILE_ENV);
+ filename = env_get(UPDATE_FILE_ENV);
if (filename == NULL) {
printf("failed, env. variable '%s' not found\n",
UPDATE_FILE_ENV);
@@ -264,7 +264,8 @@ int update_tftp(ulong addr, char *interface, char *devstring)
printf("trying update file '%s'\n", filename);
/* get load address of downloaded update file */
- if ((env_addr = getenv("loadaddr")) != NULL)
+ env_addr = env_get("loadaddr");
+ if (env_addr)
addr = simple_strtoul(env_addr, NULL, 16);
else
addr = CONFIG_UPDATE_LOAD_ADDR;
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 70bc6e2931..86a3477664 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -189,7 +189,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
* but allow this time to be increased via env variable as some
* devices break the spec and require longer warm-up times
*/
- env = getenv("usb_pgood_delay");
+ env = env_get("usb_pgood_delay");
if (env)
pgood_delay = max(pgood_delay,
(unsigned)simple_strtol(env, NULL, 0));
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index d2d29cc98f..8cbdba6ac2 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -515,7 +515,7 @@ static int probe_usb_keyboard(struct usb_device *dev)
if (error)
return error;
- stdinname = getenv("stdin");
+ stdinname = env_get("stdin");
#if CONFIG_IS_ENABLED(CONSOLE_MUX)
error = iomux_doenv(stdin, stdinname);
if (error)
@@ -582,7 +582,7 @@ int usb_kbd_deregister(int force)
if (stdio_deregister_dev(dev, force) != 0)
return 1;
#if CONFIG_IS_ENABLED(CONSOLE_MUX)
- if (iomux_doenv(stdin, getenv("stdin")) != 0)
+ if (iomux_doenv(stdin, env_get("stdin")) != 0)
return 1;
#endif
#ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
@@ -627,7 +627,7 @@ static int usb_kbd_remove(struct udevice *dev)
goto err;
}
#if CONFIG_IS_ENABLED(CONSOLE_MUX)
- if (iomux_doenv(stdin, getenv("stdin"))) {
+ if (iomux_doenv(stdin, env_get("stdin"))) {
ret = -ENOLINK;
goto err;
}