Fix incorrect use of getenv() before relocation
[oweals/u-boot.git] / board / gdsys / neo / neo.c
index a56c2cc98794d688c0fa9fb2a7f40910c35ceed6..d21d599fa70ecaa8b6cff4ba2a30b452e287250b 100644 (file)
@@ -53,7 +53,8 @@ int board_early_init_f(void)
  */
 int checkboard(void)
 {
-       char *s = getenv("serial#");
+       char buf[64];
+       int i = getenv_f("serial#", buf, sizeof(buf));
        u16 val = in_le16((void *)CONFIG_FPGA_BASE + 2);
        u8 unit_type;
        u8 hardware_cpu_ports;
@@ -62,9 +63,9 @@ int checkboard(void)
 
        printf("Board: CATCenter Neo");
 
-       if (s != NULL) {
+       if (i > 0) {
                puts(", serial# ");
-               puts(s);
+               puts(buf);
        }
        puts("\n       ");