summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-11-02 11:49:42 -0600
committerTom Rini <[email protected]>2024-12-18 15:18:59 -0600
commitfc37a73e667916e15e01e0f9d189da792df2b351 (patch)
treedfbf6aa2fd3a9af4d7900f929d06ea753b009670 /lib
parent447f18d00de80384df334acdbe5972762d3d1e1e (diff)
fdt: Swap the signature for board_fdt_blob_setup()
This returns a devicetree and updates a parameter with an error code. Swap it, since this fits better with the way U-Boot normally works. It also (more easily) allows leaving the existing pointer unchanged. No yaks were harmed in this change, but there is a very small code-size reduction. For sifive, the OF_BOARD option must be set for the function to be called, so there is no point in checking it again. Also OF_SEPARATE is defined always. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> [trini: Update total_compute] Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'lib')
-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 */