diff options
author | Tom Rini <trini@konsulko.com> | 2021-05-18 11:09:41 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-05-18 11:09:41 -0400 |
commit | 52993fcb7672885ea827ef3f24927d650bca2e4e (patch) | |
tree | c4547bdbf6ee732a28f56e4c845e45f7ae565ac6 /arch/riscv/lib/fdt_fixup.c | |
parent | feddbdb55f47b94f9f6695dc19a826953f893f7a (diff) | |
parent | 89419279f4fe6bfd68dd518059ef2007295f1cb4 (diff) |
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
Diffstat (limited to 'arch/riscv/lib/fdt_fixup.c')
-rw-r--r-- | arch/riscv/lib/fdt_fixup.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c index 1f3f23621c3..f636b284497 100644 --- a/arch/riscv/lib/fdt_fixup.c +++ b/arch/riscv/lib/fdt_fixup.c @@ -151,14 +151,17 @@ int arch_fixup_fdt(void *blob) } chosen_offset = fdt_path_offset(blob, "/chosen"); if (chosen_offset < 0) { - err = fdt_add_subnode(blob, 0, "chosen"); - if (err < 0) { + chosen_offset = fdt_add_subnode(blob, 0, "chosen"); + if (chosen_offset < 0) { log_err("chosen node cannot be added\n"); - return err; + return chosen_offset; } } /* Overwrite the boot-hartid as U-Boot is the last stage BL */ - fdt_setprop_u32(blob, chosen_offset, "boot-hartid", gd->arch.boot_hart); + err = fdt_setprop_u32(blob, chosen_offset, "boot-hartid", + gd->arch.boot_hart); + if (err < 0) + return log_msg_ret("could not set boot-hartid", err); #endif /* Copy the reserved-memory node to the DT used by OS */ |