diff options
author | Simon Glass <sjg@chromium.org> | 2017-08-03 12:22:12 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-08-16 08:30:24 -0400 |
commit | 00caae6d47645e68d6e5277aceb69592b49381a6 (patch) | |
tree | c361aa0cea3093b93c1118266fe9e2b44ac6e453 /drivers/video | |
parent | fd1e959e91d2b0b2e853d09dd9167dfff18a616c (diff) |
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/video')
-rw-r--r-- | drivers/video/ati_radeon_fb.c | 3 | ||||
-rw-r--r-- | drivers/video/cfb_console.c | 2 | ||||
-rw-r--r-- | drivers/video/mb862xx.c | 3 | ||||
-rw-r--r-- | drivers/video/mx3fb.c | 2 | ||||
-rw-r--r-- | drivers/video/mxsfb.c | 2 | ||||
-rw-r--r-- | drivers/video/videomodes.c | 5 |
6 files changed, 10 insertions, 7 deletions
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; |