summaryrefslogtreecommitdiff
path: root/lib/fdtdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fdtdec.c')
-rw-r--r--lib/fdtdec.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 60e28173c03..c5d29d4385a 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1706,11 +1706,17 @@ int fdtdec_setup(void)
/* Allow the board to override the fdt address. */
if (IS_ENABLED(CONFIG_OF_BOARD)) {
- gd->fdt_blob = board_fdt_blob_setup(&ret);
- if (!ret)
+ void *blob;
+
+ blob = (void *)gd->fdt_blob;
+ ret = board_fdt_blob_setup(&blob);
+ if (ret) {
+ if (ret != -EEXIST)
+ return ret;
+ } else {
gd->fdt_src = FDTSRC_BOARD;
- else if (ret != -EEXIST)
- return ret;
+ gd->fdt_blob = blob;
+ }
}
/* Allow the early environment to override the fdt address */