Skip to content
Snippets Groups Projects
Commit 35940de1 authored by Miao Yan's avatar Miao Yan Committed by Tom Rini
Browse files

common/fdt_support.c: avoid unintended return from fdt_fixup_memory_banks()


fdt_fixup_memory_banks() will add and update /memory node in
device tree blob. In the case that /memory node doesn't exist,
after adding a new one, this function returns error.

The correct behavior should be continuing to update its properties.

Signed-off-by: default avatarMiao Yan <miao.yan@windriver.com>
parent 871a57bb
No related branches found
No related tags found
No related merge requests found
...@@ -400,10 +400,11 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks) ...@@ -400,10 +400,11 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
nodeoffset = fdt_path_offset(blob, "/memory"); nodeoffset = fdt_path_offset(blob, "/memory");
if (nodeoffset < 0) { if (nodeoffset < 0) {
nodeoffset = fdt_add_subnode(blob, 0, "memory"); nodeoffset = fdt_add_subnode(blob, 0, "memory");
if (nodeoffset < 0) if (nodeoffset < 0) {
printf("WARNING: could not create /memory: %s.\n", printf("WARNING: could not create /memory: %s.\n",
fdt_strerror(nodeoffset)); fdt_strerror(nodeoffset));
return nodeoffset; return nodeoffset;
}
} }
err = fdt_setprop(blob, nodeoffset, "device_type", "memory", err = fdt_setprop(blob, nodeoffset, "device_type", "memory",
sizeof("memory")); sizeof("memory"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment