ARM: uniphier: select CONFIG_ARMV8_SPIN_TABLE
[oweals/u-boot.git] / arch / arm / mach-uniphier / board_late_init.c
index 845f047b027da675425f70f1d7bf548b28e2e549..a45412677a0ffcfad93ca01f7a6ee222471f90ce 100644 (file)
@@ -39,6 +39,9 @@ static int uniphier_set_fdt_file(void)
        int buf_len = 256;
        int ret;
 
+       if (getenv("fdt_file"))
+               return 0;       /* do nothing if it is already set */
+
        ret = fdt_get_string(gd->fdt_blob, 0, "compatible", &compat);
        if (ret)
                return -EINVAL;
@@ -56,9 +59,7 @@ static int uniphier_set_fdt_file(void)
 
        strncat(dtb_name, ".dtb", buf_len);
 
-       setenv("fdt_file", dtb_name);
-
-       return 0;
+       return setenv("fdt_file", dtb_name);
 }
 
 int board_late_init(void)