
On 21/10/2024 13:42, Simon Glass wrote:
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.
Signed-off-by: Simon Glass sjg@chromium.org
arch/arm/mach-apple/board.c | 7 ++-- arch/arm/mach-snapdragon/board.c | 7 ++-- arch/arm/mach-stm32mp/boot_params.c | 19 ++++++----- arch/sandbox/cpu/cpu.c | 34 ++++++++----------- board/Marvell/octeontx/board-fdt.c | 12 +++---- board/Marvell/octeontx2/board-fdt.c | 12 +++---- board/Marvell/octeontx2/board.c | 2 +- board/andestech/ae350/ae350.c | 23 +++++++------ board/armltd/vexpress64/vexpress64.c | 31 ++++++++--------- board/broadcom/bcmstb/bcmstb.c | 7 ++-- board/emulation/qemu-arm/qemu-arm.c | 7 ++-- board/emulation/qemu-ppce500/qemu-ppce500.c | 12 +++---- board/emulation/qemu-riscv/qemu-riscv.c | 7 ++-- board/highbank/highbank.c | 7 ++-- board/raspberrypi/rpi/rpi.c | 13 ++++--- board/sifive/unleashed/unleashed.c | 9 ++--- board/sifive/unmatched/unmatched.c | 9 ++--- .../visionfive2/starfive_visionfive2.c | 9 ++--- board/xen/xenguest_arm64/xenguest_arm64.c | 14 ++++---- board/xilinx/common/board.c | 26 ++++++++------ include/fdtdec.h | 8 +++-- lib/fdtdec.c | 13 ++++--- 22 files changed, 146 insertions(+), 142 deletions(-)
[...]
diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index ab5ea85cf9f..5ce6bee7316 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -503,15 +503,14 @@ int board_init(void) /*
- If the firmware passed a device tree use it for U-Boot.
*/ -void *board_fdt_blob_setup(int *err) +int board_fdt_blob_setup(void **fdtp) {
- *err = 0;
- if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC) {
*err = -ENXIO;
return NULL;
- }
- if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC)
return -ENXIO;
- return (void *)fw_dtb_pointer;
*fdtp = (void *)fw_dtb_pointer;
return 0; }
int copy_property(void *dst, void *src, char *path, char *property)
Reviewed-by: Matthias Brugger mbrugger@suse.com