diff --git a/lib/fdtdec.c b/lib/fdtdec.c index b2c59ab3818..647459c1b0e 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -1685,8 +1685,8 @@ int fdtdec_setup(void) } } - /* Otherwise, the devicetree is typically appended to U-Boot */ if (ret) { + /* Otherwise, the devicetree is typically appended to U-Boot */ if (IS_ENABLED(CONFIG_OF_SEPARATE)) { gd->fdt_blob = fdt_find_separate(); gd->fdt_src = FDTSRC_SEPARATE; @@ -1694,15 +1694,15 @@ int fdtdec_setup(void) gd->fdt_blob = dtb_dt_embedded(); gd->fdt_src = FDTSRC_EMBED; } - } - /* Allow the board to override the fdt address. */ - if (IS_ENABLED(CONFIG_OF_BOARD)) { - gd->fdt_blob = board_fdt_blob_setup(&ret); - if (!ret) - gd->fdt_src = FDTSRC_BOARD; - else if (ret != -EEXIST) - return ret; + /* Allow the board to override the fdt address. */ + if (IS_ENABLED(CONFIG_OF_BOARD)) { + gd->fdt_blob = board_fdt_blob_setup(&ret); + if (!ret) + gd->fdt_src = FDTSRC_BOARD; + else if (ret != -EEXIST) + return ret; + } } /* Allow the early environment to override the fdt address */