diff mbox series

[U-Boot,5/6] fdt: boot_get_fdt: android: compress handling (non-functional)

Message ID 20190331020838.26683-5-erosca@de.adit-jv.com
State Superseded
Delegated to: Simon Glass
Headers show
Series [U-Boot,1/6] fdt: boot_get_fdt: remove redundant zeroing out | expand

Commit Message

Eugeniu Rosca March 31, 2019, 2:08 a.m. UTC
Prepare for booting Android images which lack any DTB in the second
area using 'fdtaddr' environment variable as source/address of FDT.
No functional/behavioral change expected in this patch.

Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---
 common/image-fdt.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/common/image-fdt.c b/common/image-fdt.c
index 250f99aaaedd..8fea54335e99 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -457,14 +457,13 @@  int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch,
 		struct andr_img_hdr *hdr = buf;
 		ulong fdt_data;
 
-		if (android_image_get_second(hdr, &fdt_data, &fdt_len) != 0)
-			goto no_fdt;
-
-		fdt_blob = (char *)fdt_data;
-		if (fdt_check_header(fdt_blob) != 0)
+		if (!android_image_get_second(hdr, &fdt_data, &fdt_len) &&
+		    !fdt_check_header((char *)fdt_data)) {
+			fdt_blob = (char *)fdt_data;
+			debug("## Using FDT in Android image second area\n");
+		} else {
 			goto no_fdt;
-
-		debug("## Using FDT found in Android image second area\n");
+		}
 #endif
 	} else {
 		debug("## No Flattened Device Tree\n");