summaryrefslogtreecommitdiff
path: root/drivers
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 /drivers
parentfd1e959e91d2b0b2e853d09dd9167dfff18a616c (diff)
downloadu-boot-00caae6d47645e68d6e5277aceb69592b49381a6.tar.gz
u-boot-00caae6d47645e68d6e5277aceb69592b49381a6.tar.bz2
u-boot-00caae6d47645e68d6e5277aceb69592b49381a6.zip
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 'drivers')
-rw-r--r--drivers/ddr/fsl/fsl_ddr_gen4.c2
-rw-r--r--drivers/ddr/fsl/interactive.c8
-rw-r--r--drivers/ddr/fsl/options.c6
-rw-r--r--drivers/dfu/dfu.c6
-rw-r--r--drivers/dfu/dfu_mmc.c2
-rw-r--r--drivers/input/i8042.c2
-rw-r--r--drivers/input/input.c2
-rw-r--r--drivers/mtd/cfi_flash.c2
-rw-r--r--drivers/net/fec_mxc.c2
-rw-r--r--drivers/net/fm/b4860.c2
-rw-r--r--drivers/net/fm/fdt.c2
-rw-r--r--drivers/net/fsl-mc/mc.c6
-rw-r--r--drivers/net/netconsole.c8
-rw-r--r--drivers/net/phy/micrel_ksz90x1.c4
-rw-r--r--drivers/pci/fsl_pci_init.c4
-rw-r--r--drivers/pci/pci.c4
-rw-r--r--drivers/pci/pci_common.c2
-rw-r--r--drivers/rtc/m41t60.c2
-rw-r--r--drivers/serial/usbtty.c9
-rw-r--r--drivers/usb/gadget/designware_udc.c2
-rw-r--r--drivers/usb/gadget/ether.c12
-rw-r--r--drivers/usb/gadget/f_dfu.c2
-rw-r--r--drivers/usb/gadget/f_fastboot.c6
-rw-r--r--drivers/usb/host/ehci-fsl.c2
-rw-r--r--drivers/video/ati_radeon_fb.c3
-rw-r--r--drivers/video/cfb_console.c2
-rw-r--r--drivers/video/mb862xx.c3
-rw-r--r--drivers/video/mx3fb.c2
-rw-r--r--drivers/video/mxsfb.c2
-rw-r--r--drivers/video/videomodes.c5
30 files changed, 59 insertions, 57 deletions
diff --git a/drivers/ddr/fsl/fsl_ddr_gen4.c b/drivers/ddr/fsl/fsl_ddr_gen4.c
index 3349fc5c3b..058c9b9da8 100644
--- a/drivers/ddr/fsl/fsl_ddr_gen4.c
+++ b/drivers/ddr/fsl/fsl_ddr_gen4.c
@@ -469,7 +469,7 @@ step2:
#define CTLR_INTLV_MASK 0x20000000
/* Perform build-in test on memory. Three-way interleaving is not yet
* supported by this code. */
- if (getenv_f("ddr_bist", buffer, CONFIG_SYS_CBSIZE) >= 0) {
+ if (env_get_f("ddr_bist", buffer, CONFIG_SYS_CBSIZE) >= 0) {
puts("Running BIST test. This will take a while...");
cs0_config = ddr_in32(&ddr->cs0_config);
cs0_bnds = ddr_in32(&ddr->cs0_bnds);
diff --git a/drivers/ddr/fsl/interactive.c b/drivers/ddr/fsl/interactive.c
index 653bbabc95..c99bd2fb6d 100644
--- a/drivers/ddr/fsl/interactive.c
+++ b/drivers/ddr/fsl/interactive.c
@@ -1861,7 +1861,7 @@ int fsl_ddr_interactive_env_var_exists(void)
{
char buffer[CONFIG_SYS_CBSIZE];
- if (getenv_f("ddr_interactive", buffer, CONFIG_SYS_CBSIZE) >= 0)
+ if (env_get_f("ddr_interactive", buffer, CONFIG_SYS_CBSIZE) >= 0)
return 1;
return 0;
@@ -1891,11 +1891,11 @@ unsigned long long fsl_ddr_interactive(fsl_ddr_info_t *pinfo, int var_is_set)
};
if (var_is_set) {
- if (getenv_f("ddr_interactive", buffer2, CONFIG_SYS_CBSIZE) > 0) {
+ if (env_get_f("ddr_interactive", buffer2,
+ CONFIG_SYS_CBSIZE) > 0)
p = buffer2;
- } else {
+ else
var_is_set = 0;
- }
}
/*
diff --git a/drivers/ddr/fsl/options.c b/drivers/ddr/fsl/options.c
index 20edd2dc28..a7eaed1bd7 100644
--- a/drivers/ddr/fsl/options.c
+++ b/drivers/ddr/fsl/options.c
@@ -18,7 +18,7 @@
* Use our own stack based buffer before relocation to allow accessing longer
* hwconfig strings that might be in the environment before we've relocated.
* This is pretty fragile on both the use of stack and if the buffer is big
- * enough. However we will get a warning from getenv_f for the later.
+ * enough. However we will get a warning from env_get_f() for the latter.
*/
/* Board-specific functions defined in each board's ddr.c */
@@ -755,7 +755,7 @@ unsigned int populate_memctl_options(const common_timing_params_t *common_dimm,
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
- if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
+ if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
buf = buffer;
#if defined(CONFIG_SYS_FSL_DDR3) || \
@@ -1399,7 +1399,7 @@ int fsl_use_spd(void)
* Extract hwconfig from environment since we have not properly setup
* the environment but need it for ddr config params
*/
- if (getenv_f("hwconfig", buffer, sizeof(buffer)) > 0)
+ if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
buf = buffer;
/* if hwconfig is not enabled, or "sdram" is not defined, use spd */
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index f6281f4baa..ff732ac309 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -62,7 +62,7 @@ int dfu_init_env_entities(char *interface, char *devstr)
#ifdef CONFIG_SET_DFU_ALT_INFO
set_dfu_alt_info(interface, devstr);
#endif
- 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;
@@ -101,7 +101,7 @@ unsigned char *dfu_get_buf(struct dfu_entity *dfu)
if (dfu_buf != NULL)
return dfu_buf;
- s = getenv("dfu_bufsiz");
+ s = env_get("dfu_bufsiz");
if (s)
dfu_buf_size = (unsigned long)simple_strtol(s, NULL, 0);
@@ -123,7 +123,7 @@ static char *dfu_get_hash_algo(void)
{
char *s;
- s = getenv("dfu_hash_algo");
+ s = env_get("dfu_hash_algo");
if (!s)
return NULL;
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index bb23e7fdcb..39e10b1a5a 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -161,7 +161,7 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
}
if (op != DFU_OP_WRITE) {
- str_env = getenv("filesize");
+ str_env = env_get("filesize");
if (str_env == NULL) {
puts("dfu: Wrong file size!\n");
return -1;
diff --git a/drivers/input/i8042.c b/drivers/input/i8042.c
index 0fd25b17ec..18476e97d1 100644
--- a/drivers/input/i8042.c
+++ b/drivers/input/i8042.c
@@ -274,7 +274,7 @@ static int i8042_start(struct udevice *dev)
/* Init keyboard device (default US layout) */
keymap = KBD_US;
- penv = getenv("keymap");
+ penv = env_get("keymap");
if (penv != NULL) {
if (strncmp(penv, "de", 3) == 0)
keymap = KBD_GER;
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 011667fedd..26da3a95ff 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -652,7 +652,7 @@ int input_stdio_register(struct stdio_dev *dev)
error = stdio_register(dev);
/* check if this is the standard input device */
- if (!error && strcmp(getenv("stdin"), dev->name) == 0) {
+ if (!error && strcmp(env_get("stdin"), dev->name) == 0) {
/* reassign the console */
if (OVERWRITE_CONSOLE ||
console_assign(stdin, dev->name))
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 048a51785e..42bc2efd90 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2353,7 +2353,7 @@ unsigned long flash_init (void)
#ifdef CONFIG_SYS_FLASH_PROTECTION
/* read environment from EEPROM */
char s[64];
- getenv_f("unlock", s, sizeof(s));
+ env_get_f("unlock", s, sizeof(s));
#endif
#ifdef CONFIG_CFI_FLASH /* for driver model */
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 424c347e0e..797e34f7cc 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -1096,7 +1096,7 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
sprintf(mac, "eth%daddr", fec->dev_id);
else
strcpy(mac, "ethaddr");
- if (!getenv(mac))
+ if (!env_get(mac))
eth_env_set_enetaddr(mac, ethaddr);
}
return ret;
diff --git a/drivers/net/fm/b4860.c b/drivers/net/fm/b4860.c
index 5aeeb87282..3245bee473 100644
--- a/drivers/net/fm/b4860.c
+++ b/drivers/net/fm/b4860.c
@@ -97,7 +97,7 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
* Extract hwconfig from environment since environment
* is not setup yet
*/
- getenv_f("hwconfig", buffer, sizeof(buffer));
+ env_get_f("hwconfig", buffer, sizeof(buffer));
buf = buffer;
/* check if XFI interface enable in hwconfig for 10g */
diff --git a/drivers/net/fm/fdt.c b/drivers/net/fm/fdt.c
index 9918d8089a..5920fecea1 100644
--- a/drivers/net/fm/fdt.c
+++ b/drivers/net/fm/fdt.c
@@ -36,7 +36,7 @@ void fdt_fixup_fman_firmware(void *blob)
return;
/* If the environment variable is not set, then exit silently */
- p = getenv("fman_ucode");
+ p = env_get("fman_ucode");
if (!p)
return;
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 3a30c03b85..be82371766 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -530,7 +530,7 @@ static unsigned long get_mc_boot_timeout_ms(void)
{
unsigned long timeout_ms = CONFIG_SYS_LS_MC_BOOT_TIMEOUT_MS;
- char *timeout_ms_env_var = getenv(MC_BOOT_TIMEOUT_ENV_VAR);
+ char *timeout_ms_env_var = env_get(MC_BOOT_TIMEOUT_ENV_VAR);
if (timeout_ms_env_var) {
timeout_ms = simple_strtoul(timeout_ms_env_var, NULL, 10);
@@ -815,7 +815,7 @@ unsigned long mc_get_dram_block_size(void)
{
unsigned long dram_block_size = CONFIG_SYS_LS_MC_DRAM_BLOCK_MIN_SIZE;
- char *dram_block_size_env_var = getenv(MC_MEM_SIZE_ENV_VAR);
+ char *dram_block_size_env_var = env_get(MC_MEM_SIZE_ENV_VAR);
if (dram_block_size_env_var) {
dram_block_size = simple_strtoul(dram_block_size_env_var, NULL,
@@ -1518,7 +1518,7 @@ void mc_env_boot(void)
* address info properly. Without MAC addresses, the MC code
* can not properly initialize the DPC.
*/
- mc_boot_env_var = getenv(MC_BOOT_ENV_VAR);
+ mc_boot_env_var = env_get(MC_BOOT_ENV_VAR);
if (mc_boot_env_var)
run_command_list(mc_boot_env_var, -1, 0);
#endif /* CONFIG_FSL_MC_ENET */
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 3500047577..2210c57a64 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -82,11 +82,11 @@ static int refresh_settings_from_env(void)
/* update only when the environment has changed */
if (env_changed_id != env_id) {
- if (getenv("ncip")) {
+ if (env_get("ncip")) {
nc_ip = getenv_ip("ncip");
if (!nc_ip.s_addr)
return -1; /* ncip is 0.0.0.0 */
- p = strchr(getenv("ncip"), ':');
+ p = strchr(env_get("ncip"), ':');
if (p != NULL) {
nc_out_port = simple_strtoul(p + 1, NULL, 10);
nc_in_port = nc_out_port;
@@ -95,10 +95,10 @@ static int refresh_settings_from_env(void)
nc_ip.s_addr = ~0; /* ncip is not set, so broadcast */
}
- p = getenv("ncoutport");
+ p = env_get("ncoutport");
if (p != NULL)
nc_out_port = simple_strtoul(p, NULL, 10);
- p = getenv("ncinport");
+ p = env_get("ncinport");
if (p != NULL)
nc_in_port = simple_strtoul(p, NULL, 10);
diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c
index 20f8a55196..0bb99e6bc6 100644
--- a/drivers/net/phy/micrel_ksz90x1.c
+++ b/drivers/net/phy/micrel_ksz90x1.c
@@ -258,7 +258,7 @@ static int ksz9021_config(struct phy_device *phydev)
if (ret)
return ret;
- if (getenv("disable_giga"))
+ if (env_get("disable_giga"))
features &= ~(SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full);
/* force master mode for 1000BaseT due to chip errata */
@@ -344,7 +344,7 @@ static int ksz9031_config(struct phy_device *phydev)
return ret;
/* add an option to disable the gigabit feature of this PHY */
- if (getenv("disable_giga")) {
+ if (env_get("disable_giga")) {
unsigned features;
unsigned bmcr;
diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
index af20cf0f3e..df76a94144 100644
--- a/drivers/pci/fsl_pci_init.c
+++ b/drivers/pci/fsl_pci_init.c
@@ -390,7 +390,7 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
#ifdef CONFIG_SRIO_PCIE_BOOT_MASTER
/* boot from PCIE --master */
- char *s = getenv("bootmaster");
+ char *s = env_get("bootmaster");
char pcie[6];
sprintf(pcie, "PCIE%d", pci_info->pci_num);
@@ -673,7 +673,7 @@ int fsl_pci_init_port(struct fsl_pci_info *pci_info,
#ifdef CONFIG_SRIO_PCIE_BOOT_MASTER
} else {
/* boot from PCIE --master releases slave's core 0 */
- char *s = getenv("bootmaster");
+ char *s = env_get("bootmaster");
char pcie[6];
sprintf(pcie, "PCIE%d", pci_info->pci_num);
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 6b36c187b5..bbc7dab366 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -427,7 +427,7 @@ int pci_hose_scan(struct pci_controller *hose)
if (!gd->pcidelay_done) {
/* wait "pcidelay" ms (if defined)... */
- s = getenv("pcidelay");
+ s = env_get("pcidelay");
if (s) {
int val = simple_strtoul(s, NULL, 10);
for (i = 0; i < val; i++)
@@ -459,7 +459,7 @@ void pci_init(void)
hose_head = NULL;
/* allow env to disable pci init/enum */
- if (getenv("pcidisable") != NULL)
+ if (env_get("pcidisable") != NULL)
return;
/* now call board specific pci_init()... */
diff --git a/drivers/pci/pci_common.c b/drivers/pci/pci_common.c
index 6526de80db..faf25d96cb 100644
--- a/drivers/pci/pci_common.c
+++ b/drivers/pci/pci_common.c
@@ -89,7 +89,7 @@ __weak int pci_skip_dev(struct pci_controller *hose, pci_dev_t dev)
/*
* Only skip configuration if "pciconfighost" is not set
*/
- if (getenv("pciconfighost") == NULL)
+ if (env_get("pciconfighost") == NULL)
return 1;
#else
return 1;
diff --git a/drivers/rtc/m41t60.c b/drivers/rtc/m41t60.c
index 95083f0d72..2ddfd4ea5c 100644
--- a/drivers/rtc/m41t60.c
+++ b/drivers/rtc/m41t60.c
@@ -200,7 +200,7 @@ int rtc_set(struct rtc_time *tmp)
void rtc_reset(void)
{
uchar *const data = rtc_validate();
- char const *const s = getenv("rtccal");
+ char const *const s = env_get("rtccal");
if (!data)
return;
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
index 29799dce93..353109c070 100644
--- a/drivers/serial/usbtty.c
+++ b/drivers/serial/usbtty.c
@@ -526,9 +526,9 @@ int drv_usbtty_init (void)
int snlen;
/* Ger seiral number */
- if (!(sn = getenv("serial#"))) {
+ sn = env_get("serial#");
+ if (!sn)
sn = "000000000000";
- }
snlen = strlen(sn);
if (snlen > sizeof(serial_number) - 1) {
printf ("Warning: serial number %s is too long (%d > %lu)\n",
@@ -540,10 +540,9 @@ int drv_usbtty_init (void)
/* Decide on which type of UDC device to be.
*/
-
- if(!(tt = getenv("usbtty"))) {
+ tt = env_get("usbtty");
+ if (!tt)
tt = "generic";
- }
usbtty_init_terminal_type(strcmp(tt,"cdc_acm"));
/* prepare buffers... */
diff --git a/drivers/usb/gadget/designware_udc.c b/drivers/usb/gadget/designware_udc.c
index 0db7a3b6c1..a25f5019e8 100644
--- a/drivers/usb/gadget/designware_udc.c
+++ b/drivers/usb/gadget/designware_udc.c
@@ -601,7 +601,7 @@ void udc_setup_ep(struct usb_device_instance *device,
if ((ep != 0) && (udc_device->device_state < STATE_ADDRESSED))
return;
- tt = getenv("usbtty");
+ tt = env_get("usbtty");
if (!tt)
tt = "generic";
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index d0105372cf..2cf5c8d31e 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2384,12 +2384,12 @@ static int _usb_eth_init(struct ether_priv *priv)
strlcpy(host_addr, CONFIG_USBNET_HOST_ADDR, sizeof(host_addr));
#endif
/* Check if the user overruled the MAC addresses */
- if (getenv("usbnet_devaddr"))
- strlcpy(dev_addr, getenv("usbnet_devaddr"),
+ if (env_get("usbnet_devaddr"))
+ strlcpy(dev_addr, env_get("usbnet_devaddr"),
sizeof(dev_addr));
- if (getenv("usbnet_hostaddr"))
- strlcpy(host_addr, getenv("usbnet_hostaddr"),
+ if (env_get("usbnet_hostaddr"))
+ strlcpy(host_addr, env_get("usbnet_hostaddr"),
sizeof(host_addr));
if (!is_eth_addr_valid(dev_addr)) {
@@ -2420,8 +2420,8 @@ static int _usb_eth_init(struct ether_priv *priv)
gadget = dev->gadget;
usb_gadget_connect(gadget);
- if (getenv("cdc_connect_timeout"))
- timeout = simple_strtoul(getenv("cdc_connect_timeout"),
+ if (env_get("cdc_connect_timeout"))
+ timeout = simple_strtoul(env_get("cdc_connect_timeout"),
NULL, 10) * CONFIG_SYS_HZ;
ts = get_timer(0);
while (!dev->network_started) {
diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index dfa4359577..bc4be712da 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -725,7 +725,7 @@ static int dfu_bind(struct usb_configuration *c, struct usb_function *f)
cdev->req->context = f_dfu;
- s = getenv("serial#");
+ s = env_get("serial#");
if (s)
g_dnl_set_serialnumber((char *)s);
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 7cd6d24bf5..d05b74b2d2 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -212,7 +212,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
f->hs_descriptors = fb_hs_function;
}
- s = getenv("serial#");
+ s = env_get("serial#");
if (s)
g_dnl_set_serialnumber((char *)s);
@@ -426,7 +426,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
sprintf(str_num, "0x%08x", CONFIG_FASTBOOT_BUF_SIZE);
strncat(response, str_num, chars_left);
} else if (!strcmp_l1("serialno", cmd)) {
- s = getenv("serial#");
+ s = env_get("serial#");
if (s)
strncat(response, s, chars_left);
else
@@ -441,7 +441,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
}
sprintf(envstr, "fastboot.%s", cmd);
- s = getenv(envstr);
+ s = env_get(envstr);
if (s) {
strncat(response, s, chars_left);
} else {
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index b57c6cd35a..62c431b99f 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -225,7 +225,7 @@ static int ehci_fsl_init(int index, struct usb_ehci *ehci,
"phy_type", &len);
#endif
else
- phy_type = getenv("usb_phy_type");
+ phy_type = env_get("usb_phy_type");
if (!phy_type) {
#ifdef CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
diff --git a/drivers/video/ati_radeon_fb.c b/drivers/video/ati_radeon_fb.c
index 07a29eaba1..5b6c42291c 100644
--- a/drivers/video/ati_radeon_fb.c
+++ b/drivers/video/ati_radeon_fb.c
@@ -637,7 +637,8 @@ void *video_hw_init(void)
videomode = CONFIG_SYS_DEFAULT_VIDEO_MODE;
/* get video mode via environment */
- if ((penv = getenv ("videomode")) != NULL) {
+ penv = env_get("videomode");
+ if (penv) {
/* deceide if it is a string */
if (penv[0] <= '9') {
videomode = (int) simple_strtoul (penv, NULL, 16);
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b6fc7e145b..6c5425c195 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -1856,7 +1856,7 @@ static void *video_logo(void)
splash_get_pos(&video_logo_xpos, &video_logo_ypos);
#ifdef CONFIG_SPLASH_SCREEN
- s = getenv("splashimage");
+ s = env_get("splashimage");
if (s != NULL) {
ret = splash_screen_prepare();
if (ret < 0)
diff --git a/drivers/video/mb862xx.c b/drivers/video/mb862xx.c
index 1c74e97c5e..e0565e1d2e 100644
--- a/drivers/video/mb862xx.c
+++ b/drivers/video/mb862xx.c
@@ -246,7 +246,8 @@ unsigned int card_init (void)
tmp = 0;
videomode = 0x310;
/* get video mode via environment */
- if ((penv = getenv ("videomode")) != NULL) {
+ penv = env_get("videomode");
+ if (penv) {
/* decide if it is a string */
if (penv[0] <= '9') {
videomode = (int) simple_strtoul (penv, NULL, 16);
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c
index 51d06d6677..78e595ea4a 100644
--- a/drivers/video/mx3fb.c
+++ b/drivers/video/mx3fb.c
@@ -816,7 +816,7 @@ void *video_hw_init(void)
videomode = CONFIG_SYS_DEFAULT_VIDEO_MODE;
/* get video mode via environment */
- penv = getenv("videomode");
+ penv = env_get("videomode");
if (penv) {
/* decide if it is a string */
if (penv[0] <= '9') {
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 0ddce3db58..9d810bab31 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -161,7 +161,7 @@ void *video_hw_init(void)
puts("Video: ");
/* Suck display configuration from "videomode" variable */
- penv = getenv("videomode");
+ penv = env_get("videomode");
if (!penv) {
puts("MXSFB: 'videomode' variable not set!\n");
return NULL;
diff --git a/drivers/video/videomodes.c b/drivers/video/videomodes.c
index cf71ad120e..6d96b33f20 100644
--- a/drivers/video/videomodes.c
+++ b/drivers/video/videomodes.c
@@ -165,7 +165,8 @@ int video_get_params (struct ctfb_res_modes *pPar, char *penv)
/* first search for the environment containing the real param string */
s = penv;
- if ((p = getenv (s)) != NULL)
+ p = env_get(s);
+ if (p)
s = p;
/*
@@ -234,7 +235,7 @@ int video_get_params (struct ctfb_res_modes *pPar, char *penv)
int video_get_video_mode(unsigned int *xres, unsigned int *yres,
unsigned int *depth, unsigned int *freq, const char **options)
{
- char *p = getenv("video-mode");
+ char *p = env_get("video-mode");
if (!p)
return 0;