mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 15:10:26 +09:00
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>
This commit is contained in:
parent
f18295d383
commit
50babaf852
@ -217,15 +217,15 @@ int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end)
|
|||||||
int is_u64;
|
int is_u64;
|
||||||
uint64_t addr, size;
|
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. */
|
/* find or create "/chosen" node. */
|
||||||
nodeoffset = fdt_find_or_add_subnode(fdt, 0, "chosen");
|
nodeoffset = fdt_find_or_add_subnode(fdt, 0, "chosen");
|
||||||
if (nodeoffset < 0)
|
if (nodeoffset < 0)
|
||||||
return nodeoffset;
|
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);
|
total = fdt_num_mem_rsv(fdt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user