]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/amcc/sequoia/sequoia.c
Fix incorrect use of getenv() before relocation
[people/ms/u-boot.git] / board / amcc / sequoia / sequoia.c
index b518aa7d72fc2e579d9cfdd42ba06e0c4c1be5f6..45e87f7631855385cbaf9dadd4aa36f151aae265 100644 (file)
@@ -331,7 +331,8 @@ int misc_init_r(void)
 
 int checkboard(void)
 {
-       char *s = getenv("serial#");
+       char buf[64];
+       int i = getenv_f("serial#", buf, sizeof(buf));
        u8 rev;
        u32 clock = get_async_pci_freq();
 
@@ -344,9 +345,9 @@ int checkboard(void)
        rev = in_8((void *)(CONFIG_SYS_BCSR_BASE + 0));
        printf(", Rev. %X, PCI-Async=%d MHz", rev, clock / 1000000);
 
-       if (s != NULL) {
+       if (i > 0) {
                puts(", serial# ");
-               puts(s);
+               puts(buf);
        }
        putc('\n');