summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMiao Yan <miao.yan@windriver.com>2013-11-28 17:51:39 +0800
committerTom Rini <trini@ti.com>2013-12-16 08:59:42 -0500
commit35940de1a6648c5adbb89d8f64ba9513bae5e063 (patch)
tree442c63ca9a4e98a235d146cc558383b98e6434c6 /common
parent871a57bb817a7f4129d924d72f308228180c49ef (diff)
downloadu-boot-35940de1a6648c5adbb89d8f64ba9513bae5e063.tar.gz
u-boot-35940de1a6648c5adbb89d8f64ba9513bae5e063.tar.bz2
u-boot-35940de1a6648c5adbb89d8f64ba9513bae5e063.zip
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>
Diffstat (limited to 'common')
-rw-r--r--common/fdt_support.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 1f0d8f5fe9..4e32b02aa2 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -400,10 +400,11 @@ 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;
+ return nodeoffset;
+ }
}
err = fdt_setprop(blob, nodeoffset, "device_type", "memory",
sizeof("memory"));