diff mbox series

[2/2] riscv: Do not return error if reserved node already exists

Message ID 20200617235131.21374-2-atish.patra@wdc.com
State Superseded
Headers show
Series [1/2] riscv: Use correct version of fdtdec_get_addr_size | expand

Commit Message

Atish Patra June 17, 2020, 11:51 p.m. UTC
Not all errors are fatal. If a reserved memory node already exists in the
destination device tree, we can continue to boot without failing.

Signed-off-by: Atish Patra <atish.patra at wdc.com>
---
 arch/riscv/lib/fdt_fixup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
index f2ec37b57b15..00b84dccbef0 100644
--- a/arch/riscv/lib/fdt_fixup.c
+++ b/arch/riscv/lib/fdt_fixup.c
@@ -62,7 +62,7 @@  int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
 		pmp_mem.end = addr + size - 1;
 		err = fdtdec_add_reserved_memory(dst, basename, &pmp_mem,
 						 &phandle);
-		if (err < 0) {
+		if (err < 0 && err != FDT_ERR_EXISTS) {
 			printf("failed to add reserved memory: %d\n", err);
 			return err;
 		}