Merge branch '2020-05-18-reduce-size-of-common.h'
[oweals/u-boot.git] / arch / arm / lib / semihosting.c
index 415ac89de9f1fe9d7f20e39d7e3928ed282617ae..904fddd6c04e0dcc279b588e3c3b642a2a215bb2 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Broadcom Corporation
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /*
@@ -14,6 +13,8 @@
  */
 #include <common.h>
 #include <command.h>
+#include <env.h>
+#include <log.h>
 
 #define SYSOPEN                0x01
 #define SYSCLOSE       0x02
@@ -181,7 +182,8 @@ static int smh_load_file(const char * const name, ulong load_addr,
        return 0;
 }
 
-static int do_smhload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_smhload(struct cmd_tbl *cmdtp, int flag, int argc,
+                     char *const argv[])
 {
        if (argc == 3 || argc == 4) {
                ulong load_addr;
@@ -200,7 +202,7 @@ static int do_smhload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                /* Optionally save returned end to the environment */
                if (argc == 4) {
                        sprintf(end_str, "0x%08lx", end_addr);
-                       setenv(argv[3], end_str);
+                       env_set(argv[3], end_str);
                }
        } else {
                return CMD_RET_USAGE;