From 00caae6d47645e68d6e5277aceb69592b49381a6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Aug 2017 12:22:12 -0600 Subject: 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 Signed-off-by: Simon Glass --- board/esd/meesc/meesc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'board/esd') diff --git a/board/esd/meesc/meesc.c b/board/esd/meesc/meesc.c index 93a02ab0ee..0c5900a15a 100644 --- a/board/esd/meesc/meesc.c +++ b/board/esd/meesc/meesc.c @@ -181,7 +181,7 @@ int checkboard(void) puts("Board: EtherCAN/2 Gateway"); break; } - if (getenv_f("serial#", str, sizeof(str)) > 0) { + if (env_get_f("serial#", str, sizeof(str)) > 0) { puts(", serial# "); puts(str); } @@ -198,7 +198,7 @@ void get_board_serial(struct tag_serialnr *serialnr) { char *str; - char *serial = getenv("serial#"); + char *serial = env_get("serial#"); if (serial) { str = strchr(serial, '_'); if (str && (strlen(str) >= 4)) { @@ -231,7 +231,8 @@ int misc_init_r(void) * In some cases this this needs to be set to 4. * Check the user has set environment mdiv to 4 to change the divisor. */ - if ((str = getenv("mdiv")) && (strcmp(str, "4") == 0)) { + str = env_get("mdiv"); + if (str && (strcmp(str, "4") == 0)) { writel((readl(&pmc->mckr) & ~AT91_PMC_MDIV) | AT91SAM9_PMC_MDIV_4, &pmc->mckr); at91_clock_init(CONFIG_SYS_AT91_MAIN_CLOCK); -- cgit v1.2.3