diff mbox series

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

Message ID 20200624215615.19256-2-atish.patra@wdc.com
State Accepted
Commit 7eb4bcc3f49c4eb7b494766163a78909f2c1f379
Delegated to: Andes
Headers show
Series Assorted fixes related to reserved memory | expand

Commit Message

Atish Patra June 24, 2020, 9:56 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@wdc.com>
---
 arch/riscv/lib/fdt_fixup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bin Meng June 24, 2020, 11:15 p.m. UTC | #1
On Thu, Jun 25, 2020 at 5:56 AM Atish Patra <atish.patra@wdc.com> wrote:
>
> 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@wdc.com>
> ---
>  arch/riscv/lib/fdt_fixup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bin.meng@windriver.com>
diff mbox series

Patch

diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
index 6db48ad04a56..05ca41b49dda 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;
 		}