mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
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: Miao Yan <miao.yan@windriver.com>
This commit is contained in:
parent
871a57bb81
commit
35940de1a6
1 changed files with 3 additions and 2 deletions
|
@ -400,11 +400,12 @@ int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
|
|||
nodeoffset = fdt_path_offset(blob, "/memory");
|
||||
if (nodeoffset < 0) {
|
||||
nodeoffset = fdt_add_subnode(blob, 0, "memory");
|
||||
if (nodeoffset < 0)
|
||||
if (nodeoffset < 0) {
|
||||
printf("WARNING: could not create /memory: %s.\n",
|
||||
fdt_strerror(nodeoffset));
|
||||
return nodeoffset;
|
||||
}
|
||||
}
|
||||
err = fdt_setprop(blob, nodeoffset, "device_type", "memory",
|
||||
sizeof("memory"));
|
||||
if (err < 0) {
|
||||
|
|
Loading…
Reference in a new issue