We will use the generic unadorned for the incoming loadable support, so add a _uimage suffix to the uimage-only members to make the association clearer.
Signed-off-by: Ahmad Fatoum <[email protected]> --- arch/powerpc/lib/ppclinux.c | 2 +- common/bootm-uimage.c | 38 ++++++++++++++++++------------------- common/bootm.c | 12 ++++++------ include/bootm.h | 4 ++-- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/arch/powerpc/lib/ppclinux.c b/arch/powerpc/lib/ppclinux.c index eda2539e6125..4e9693cbad60 100644 --- a/arch/powerpc/lib/ppclinux.c +++ b/arch/powerpc/lib/ppclinux.c @@ -30,7 +30,7 @@ static struct fdt_header *bootm_relocate_fdt(struct image_data *data, */ if (os < (void *)fdt->totalsize) { os = (void *)PAGE_ALIGN((phys_addr_t)os + - data->os->header.ih_size); + data->os_uimage->header.ih_size); os += fdt->totalsize; if (os < LINUX_TLB1_MAX_ADDR) os = LINUX_TLB1_MAX_ADDR; diff --git a/common/bootm-uimage.c b/common/bootm-uimage.c index 609b678e1d4a..b32ed5b0e95f 100644 --- a/common/bootm-uimage.c +++ b/common/bootm-uimage.c @@ -29,7 +29,7 @@ int bootm_load_uimage_os(struct image_data *data, unsigned long load_address) num = uimage_part_num(data->os_part); - data->os_res = uimage_load_to_sdram(data->os, + data->os_res = uimage_load_to_sdram(data->os_uimage, num, load_address); if (!data->os_res) return -ENOMEM; @@ -42,21 +42,21 @@ static int bootm_open_initrd_uimage(struct image_data *data) int ret; if (strcmp(data->os_file, data->initrd_file)) { - data->initrd = uimage_open(data->initrd_file); - if (!data->initrd) + data->initrd_uimage = uimage_open(data->initrd_file); + if (!data->initrd_uimage) return -EINVAL; if (bootm_get_verify_mode() > BOOTM_VERIFY_NONE) { - ret = uimage_verify(data->initrd); + ret = uimage_verify(data->initrd_uimage); if (ret) { pr_err("Checking data crc failed with %pe\n", ERR_PTR(ret)); return ret; } } - uimage_print_contents(data->initrd); + uimage_print_contents(data->initrd_uimage); } else { - data->initrd = data->os; + data->initrd_uimage = data->os_uimage; } return 0; @@ -90,7 +90,7 @@ bootm_load_uimage_initrd(struct image_data *data, unsigned long load_address) num = uimage_part_num(data->initrd_part); - res = uimage_load_to_sdram(data->initrd, + res = uimage_load_to_sdram(data->initrd_uimage, num, load_address); if (!res) return ERR_PTR(-ENOMEM); @@ -110,9 +110,9 @@ int bootm_open_oftree_uimage(struct image_data *data, size_t *size, pr_info("Loading devicetree from '%s'@%d\n", oftree, num); if (!strcmp(data->os_file, oftree)) { - of_handle = data->os; + of_handle = data->os_uimage; } else if (!strcmp(data->initrd_file, oftree)) { - of_handle = data->initrd; + of_handle = data->initrd_uimage; } else { of_handle = uimage_open(oftree); if (!of_handle) @@ -141,12 +141,12 @@ int bootm_open_uimage(struct image_data *data) { int ret; - data->os = uimage_open(data->os_file); - if (!data->os) + data->os_uimage = uimage_open(data->os_file); + if (!data->os_uimage) return -EINVAL; if (bootm_get_verify_mode() > BOOTM_VERIFY_NONE) { - ret = uimage_verify(data->os); + ret = uimage_verify(data->os_uimage); if (ret) { pr_err("Checking data crc failed with %pe\n", ERR_PTR(ret)); @@ -154,23 +154,23 @@ int bootm_open_uimage(struct image_data *data) } } - uimage_print_contents(data->os); + uimage_print_contents(data->os_uimage); - if (IH_ARCH == IH_ARCH_INVALID || data->os->header.ih_arch != IH_ARCH) { + if (IH_ARCH == IH_ARCH_INVALID || data->os_uimage->header.ih_arch != IH_ARCH) { pr_err("Unsupported Architecture 0x%x\n", - data->os->header.ih_arch); + data->os_uimage->header.ih_arch); return -EINVAL; } if (data->os_address == UIMAGE_SOME_ADDRESS) - data->os_address = data->os->header.ih_load; + data->os_address = data->os_uimage->header.ih_load; return 0; } void bootm_close_uimage(struct image_data *data) { - if (data->initrd && data->initrd != data->os) - uimage_close(data->initrd); - uimage_close(data->os); + if (data->initrd_uimage && data->initrd_uimage != data->os_uimage) + uimage_close(data->initrd_uimage); + uimage_close(data->os_uimage); } diff --git a/common/bootm.c b/common/bootm.c index a2301ea72458..7fe0afe24ce8 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -33,7 +33,7 @@ static bool uimage_check(struct image_handler *handler, enum filetype detected_filetype) { return detected_filetype == filetype_uimage && - handler->ih_os == data->os->header.ih_os; + handler->ih_os == data->os_uimage->header.ih_os; } static bool filetype_check(struct image_handler *handler, @@ -208,7 +208,7 @@ static int uimage_part_num(const char *partname) static inline bool image_is_uimage(struct image_data *data) { - return IS_ENABLED(CONFIG_BOOTM_UIMAGE) && data->os; + return IS_ENABLED(CONFIG_BOOTM_UIMAGE) && data->os_uimage; } static bool bootm_get_override(char **oldpath, const char *newpath) @@ -322,7 +322,7 @@ bootm_load_initrd(struct image_data *data, ulong load_address, ulong end_address if (type == filetype_uimage) { res = bootm_load_uimage_initrd(data, load_address); - if (data->initrd->header.ih_type == IH_TYPE_MULTI) + if (data->initrd_uimage->header.ih_type == IH_TYPE_MULTI) initrd_part = data->initrd_part; } else if (initrd) { @@ -496,7 +496,7 @@ int bootm_get_os_size(struct image_data *data) int ret; if (image_is_uimage(data)) - return uimage_get_size(data->os, uimage_part_num(data->os_part)); + return uimage_get_size(data->os_uimage, uimage_part_num(data->os_part)); if (data->os_fit) return data->fit_kernel_size; if (!data->os_file) @@ -744,7 +744,7 @@ int bootm_boot(struct bootm_data *bootm_data) pr_info("\nLoading %s '%s'", file_type_to_string(data->kernel_type), data->os_file); if (data->kernel_type == filetype_uimage && - data->os->header.ih_type == IH_TYPE_MULTI) + data->os_uimage->header.ih_type == IH_TYPE_MULTI) pr_info(", multifile image %d", uimage_part_num(data->os_part)); pr_info("\n"); @@ -758,7 +758,7 @@ int bootm_boot(struct bootm_data *bootm_data) pr_err("no image handler found for image type %s\n", file_type_to_string(data->kernel_type)); if (data->kernel_type == filetype_uimage) - pr_err("and OS type: %d\n", data->os->header.ih_os); + pr_err("and OS type: %d\n", data->os_uimage->header.ih_os); ret = -ENODEV; goto err_out; } diff --git a/include/bootm.h b/include/bootm.h index bdabba23f2b9..ef979807505d 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -59,7 +59,7 @@ struct image_data { struct resource *os_res; /* if os is an uImage this will be provided */ - struct uimage_handle *os; + struct uimage_handle *os_uimage; /* if os is a FIT image this will be provided */ struct fit_handle *os_fit; @@ -84,7 +84,7 @@ struct image_data { struct resource *initrd_res; /* if initrd is an uImage this will be provided */ - struct uimage_handle *initrd; + struct uimage_handle *initrd_uimage; char *initrd_part; /* otherwise only the filename will be provided */ -- 2.47.3
