diff options
author | Masahiro Yamada <yamada.m@jp.panasonic.com> | 2014-04-18 17:41:05 +0900 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-06-19 11:18:52 -0400 |
commit | 50babaf852e3b48680f7ea782a756043f64f8fe2 (patch) | |
tree | eb3ffab900ee19676838fe6b2c08886a3a618b07 | |
parent | f18295d3837c282f10167502e25a964abb04acf7 (diff) | |
download | u-boot-imx-50babaf852e3b48680f7ea782a756043f64f8fe2.zip u-boot-imx-50babaf852e3b48680f7ea782a756043f64f8fe2.tar.gz u-boot-imx-50babaf852e3b48680f7ea782a756043f64f8fe2.tar.bz2 |
fdt_support: correct the return condition of fdt_initrd()
Before this commit, fdt_initrd() just returned if initrd
start address is zero.
But it is possible if the RAM is located at address 0.
This commit makes the return condition more reasonable:
Just return if the size of initrd is zero.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/fdt_support.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c index 324d6b9..7927a83 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -217,15 +217,15 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end) int is_u64; uint64_t addr, size; + /* just return if the size of initrd is zero */ + if (initrd_start == initrd_end) + return 0; + /* find or create "/chosen" node. */ nodeoffset = fdt_find_or_add_subnode(fdt, 0, "chosen"); if (nodeoffset < 0) return nodeoffset; - /* just return if initrd_start/end aren't valid */ - if ((initrd_start == 0) || (initrd_end == 0)) - return 0; - total = fdt_num_mem_rsv(fdt); /* |