mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 19:34:35 +00:00
image: Fix up ANDROID_BOOT_IMAGE ramdisk code
Convert this to an if(), fix the cast from an address to a pointer and make sure that any error is returned correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
a822b9234b
commit
1ce8e10f3b
1 changed files with 12 additions and 5 deletions
|
@ -421,12 +421,19 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
|
||||||
images->fit_noffset_rd = rd_noffset;
|
images->fit_noffset_rd = rd_noffset;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_ANDROID_BOOT_IMAGE
|
|
||||||
case IMAGE_FORMAT_ANDROID:
|
case IMAGE_FORMAT_ANDROID:
|
||||||
android_image_get_ramdisk((void *)images->os.start,
|
if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) {
|
||||||
rd_datap, rd_lenp);
|
void *ptr = map_sysmem(images->os.start, 0);
|
||||||
break;
|
int ret;
|
||||||
#endif
|
|
||||||
|
ret = android_image_get_ramdisk(ptr, rd_datap,
|
||||||
|
rd_lenp);
|
||||||
|
unmap_sysmem(ptr);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
fallthrough;
|
||||||
default:
|
default:
|
||||||
if (IS_ENABLED(CONFIG_SUPPORT_RAW_INITRD)) {
|
if (IS_ENABLED(CONFIG_SUPPORT_RAW_INITRD)) {
|
||||||
char *end = NULL;
|
char *end = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue