]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - board/tqc/tqm8260/tqm8260.c
Fix incorrect use of getenv() before relocation
[karo-tx-uboot.git] / board / tqc / tqm8260 / tqm8260.c
index 3039999f3ba89a4b98764c777c85c5b53e729aea..65a3174ec681cd268856589208a7f5481bc71aa2 100644 (file)
@@ -195,17 +195,17 @@ const iop_conf_t iop_conf_tab[4][32] = {
  */
 int checkboard (void)
 {
-       char str[64];
-       int i = getenv_r ("serial#", str, sizeof (str));
+       char buf[64];
+       int i = getenv_f("serial#", buf, sizeof(buf));
 
        puts ("Board: ");
 
-       if (!i || strncmp (str, "TQM82", 5)) {
+       if (i < 0 || strncmp(buf, "TQM82", 5)) {
                puts ("### No HW ID - assuming TQM8260\n");
                return (0);
        }
 
-       puts (str);
+       puts (buf);
        putc ('\n');
 
        return 0;