]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/xes/common/board.c
env: Rename getenv/_f() to env_get()
[people/ms/u-boot.git] / board / xes / common / board.c
index 738f0a6486b483395a2c7f37bb8b3144e5b868ac..b76eb948d50ccec8a7ebdf8532c32d7c1ffcd946 100644 (file)
@@ -1,10 +1,7 @@
 /*
  * Copyright 2009 Extreme Engineering Solutions, Inc.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -13,7 +10,9 @@
 int checkboard(void)
 {
        char name[] = CONFIG_SYS_BOARD_NAME;
+       char buf[64];
        char *s;
+       int i;
 
 #ifdef CONFIG_SYS_FORM_CUSTOM
        s = "Custom";
@@ -52,12 +51,15 @@ int checkboard(void)
 
        /* Display board specific information */
        puts("       ");
-       if ((s = getenv("board_rev")))
-               printf("Rev %s, ", s);
-       if ((s = getenv("serial#")))
-               printf("Serial# %s, ", s);
-       if ((s = getenv("board_cfg")))
-               printf("Cfg %s", s);
+       i = env_get_f("board_rev", buf, sizeof(buf));
+       if (i > 0)
+               printf("Rev %s, ", buf);
+       i = env_get_f("serial#", buf, sizeof(buf));
+       if (i > 0)
+               printf("Serial# %s, ", buf);
+       i = env_get_f("board_cfg", buf, sizeof(buf));
+       if (i > 0)
+               printf("Cfg %s", buf);
        puts("\n");
 
        return 0;