board: samsung: fix the compile error with tizen_defconfig
authorJaehoon Chung <jh80.chung@samsung.com>
Thu, 3 May 2018 02:41:52 +0000 (11:41 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 10 Oct 2019 04:38:40 +0000 (13:38 +0900)
Fix the compile error during rebase on v2018.03.

Change-Id: I6207c86b495cb064591bd6d9dec8a0ef1ef527e9
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
board/samsung/common/exynos4-dt.c
board/samsung/common/misc.c
lib/rand.c

index bb4cdd76a5070a5178a9a8dfc5923a194efbe14f..17d57ef3e1066057dfe3b9b1c0d3cb02a339bfa6 100644 (file)
@@ -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;
 }
index 2b79ae6da8d69e879025259cda99d5850cf38cc6..eaf73a5f9773213652a8ce1e5d4b56e9785fe9e6 100644 (file)
@@ -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);
index af4cf3a0e8cfc7d2dc7ecec29f376e9cf8588a2f..46561bb531061595810afd4527d6e2625627712f 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <common.h>
 
+#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