From 15b155b7a7bed48cdcb92d7fd285f44c67598df5 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 3 May 2018 11:41:52 +0900 Subject: [PATCH] board: samsung: fix the compile error with tizen_defconfig Fix the compile error during rebase on v2018.03. Change-Id: I6207c86b495cb064591bd6d9dec8a0ef1ef527e9 Signed-off-by: Jaehoon Chung --- board/samsung/common/exynos4-dt.c | 4 ++-- board/samsung/common/misc.c | 30 +++++++++++++++--------------- lib/rand.c | 2 ++ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/board/samsung/common/exynos4-dt.c b/board/samsung/common/exynos4-dt.c index bb4cdd7..17d57ef 100644 --- a/board/samsung/common/exynos4-dt.c +++ b/board/samsung/common/exynos4-dt.c @@ -217,9 +217,9 @@ char *get_dfu_alt_system(char *interface, char *devstr) char *alt_system; if (board_is_trats2()) - alt_system = getenv("dfu_alt_system_trats"); + alt_system = env_get("dfu_alt_system_trats"); else - alt_system = getenv("dfu_alt_system_odroid"); + alt_system = env_get("dfu_alt_system_odroid"); return alt_system; } diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 2b79ae6..eaf73a5 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -62,7 +62,7 @@ static char *getenv_by_args(const char *fmt, ...) va_end(args); /* Get source variable */ - env_var = getenv(buf); + env_var = env_get(buf); if (!env_var) { DBG("DBG: ${%s} not found!\n", buf); return NULL; @@ -78,9 +78,9 @@ static int platform_write(bool save_env) char *platname; char *partitions; - platname = getenv("platname"); + platname = env_get("platname"); if (!platname) { - error("Undefined platname!\n"); + printf("Undefined platname!\n"); return CMD_RET_FAILURE; } @@ -95,11 +95,11 @@ static int platform_write(bool save_env) } if (save_env && run_command("saveenv", 0)) { - error("Environment save failed"); + printf("Environment save failed"); return CMD_RET_FAILURE; } - partitions = getenv("partitions"); + partitions = env_get("partitions"); if (!partitions) { printf("Partition table not changed.\n"); return CMD_RET_SUCCESS; @@ -107,7 +107,7 @@ static int platform_write(bool save_env) ret = run_command("gpt write mmc 0 $partitions", 0); if (ret) { - error("gpt write failed"); + printf("gpt write failed"); return ret; } @@ -129,9 +129,9 @@ int platform_setup(void) const char *platname; int i; - platname = getenv("platname"); + platname = env_get("platname"); if (!platname) { - error("Undefined platname!\n"); + printf("Undefined platname!\n"); return CMD_RET_FAILURE; } @@ -164,7 +164,7 @@ int platform_setup(void) /* Get setup count for ${platname} */ env_setup_cnt = getenv_by_args("%s_setup_cnt", platname); if (!env_setup_cnt) { - error("Platform setup count not found!\n"); + printf("Platform setup count not found!\n"); return CMD_RET_FAILURE; } setup_cnt = simple_strtoul(env_setup_cnt, NULL, 0); @@ -186,29 +186,29 @@ int platform_setup(void) /* Set dfu_alt_system_${board} */ snprintf(buf, buf_len, "dfu_alt_system_%s", platname); DBG("DBG: setenv($%s, %.16s[...])\n", buf, value); - setenv(buf, value); + env_set(buf, value); /* Get ${platname}_setup_N_partitions */ value = getenv_by_args("%s_setup_%d_partitions", platname, i); /* Set ${partitions} - NULL if not GPT */ DBG("DBG: setenv($partitions, %.16s[...])\n", value); - setenv("partitions", value); + env_set("partitions", value); /* Set ${mmcbootpart} */ value = getenv_by_args("%s_setup_%d_bootpart", platname, i); DBG("DBG: setenv($mmcbootpart, %s)\n", value); - setenv("mmcbootpart", value); + env_set("mmcbootpart", value); /* Set ${mmcrootpart} */ value = getenv_by_args("%s_setup_%d_rootpart", platname, i); DBG("DBG: setenv($mmcrootpart, %s)\n", value); - setenv("mmcrootpart", value); + env_set("mmcrootpart", value); /* Set active setup */ snprintf(buf, buf_len, "%s_setup_active", platname); snprintf(buf_num, buf_num_len, "%d", i); DBG("DBG: setenv($%s, %s)\n", buf, buf_num); - setenv(buf, buf_num); + env_set(buf, buf_num); printf("Setup:[%d] activated!\n", i); setup_done = 1; @@ -294,7 +294,7 @@ void set_board_info(void) #ifdef CONFIG_OF_MULTI bdname = get_board_name(); #ifdef CONFIG_PLATFORM_SETUP - setenv("platname", bdname); + env_set("platname", bdname); #endif #endif sprintf(info, "%s%s", bdname, bdtype); diff --git a/lib/rand.c b/lib/rand.c index af4cf3a..46561bb 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -9,6 +9,7 @@ #include +#ifndef CONFIG_LIB_HW_RAND static unsigned int y = 1U; unsigned int rand_r(unsigned int *seedp) @@ -29,3 +30,4 @@ void srand(unsigned int seed) { y = seed; } +#endif -- 2.7.4