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>
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 7ff7b26..530f149 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -247,7 +247,7 @@
{
const char *fdtfile;
- if (getenv("fdtfile"))
+ if (env_get("fdtfile"))
return;
fdtfile = model->fdtfile;
@@ -260,7 +260,7 @@
*/
static void set_fdt_addr(void)
{
- if (getenv("fdt_addr"))
+ if (env_get("fdt_addr"))
return;
if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC)
@@ -287,7 +287,7 @@
if (!model->has_onboard_eth)
return;
- if (getenv("usbethaddr"))
+ if (env_get("usbethaddr"))
return;
BCM2835_MBOX_INIT_HDR(msg);
@@ -302,8 +302,8 @@
eth_env_set_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac);
- if (!getenv("ethaddr"))
- env_set("ethaddr", getenv("usbethaddr"));
+ if (!env_get("ethaddr"))
+ env_set("ethaddr", env_get("usbethaddr"));
return;
}
@@ -330,7 +330,7 @@
int ret;
char serial_string[17] = { 0 };
- if (getenv("serial#"))
+ if (env_get("serial#"))
return;
BCM2835_MBOX_INIT_HDR(msg);