From: Miao Yan Date: Tue, 17 Sep 2013 19:34:02 +0800 Subject: [U-Boot] [PATCH v2 4/5] common/fdt_support.c: avoid unintended return from fdt_fixup_memory_banks() In-Reply-To: <1379417643-6106-1-git-send-email-miao.yan@windriver.com> References: <1379325490-3462-1-git-send-email-miao.yan@windriver.com> <1379417643-6106-1-git-send-email-miao.yan@windriver.com> Message-ID: <1379417643-6106-5-git-send-email-miao.yan@windriver.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- Changes for v2: none common/fdt_support.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index b034c98..a97a705 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")); -- 1.7.9.5