summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-08-22 07:54:53 -0600
committerTom Rini <trini@konsulko.com>2024-08-23 15:58:41 -0600
commitbf85af66c0d326a018396b660e5c1b03c0257d3e (patch)
treee56ad967b453c7cdbbc38173ae6ad79e25384f81
parentaf4ff286ae8dae0f5a3f5bc691ca9dfc3644ef80 (diff)
spl: Remove remaining #ifdef in spl_parse_image_header()
Define spl_set_header_raw_uboot() always so we can drop the last #ifdef in this function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
-rw-r--r--common/spl/spl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index f32e62152bf..7c6e322ffd7 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -245,7 +245,6 @@ __weak struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
return map_sysmem(CONFIG_TEXT_BASE + offset, 0);
}
-#ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT
void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
{
ulong u_boot_pos = spl_get_image_pos();
@@ -273,7 +272,6 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
spl_image->os = IH_OS_U_BOOT;
spl_image->name = "U-Boot";
}
-#endif
__weak int spl_parse_board_header(struct spl_image_info *spl_image,
const struct spl_boot_device *bootdev,
@@ -357,16 +355,16 @@ int spl_parse_image_header(struct spl_image_info *spl_image,
sizeof(*header)))
return 0;
-#ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT
+ if (IS_ENABLED(CONFIG_SPL_RAW_IMAGE_SUPPORT)) {
/* Signature not found - assume u-boot.bin */
debug("mkimage signature not found - ih_magic = %x\n",
- header->ih_magic);
+ header->ih_magic);
spl_set_header_raw_uboot(spl_image);
-#else
+ } else {
/* RAW image not supported, proceed to other boot methods. */
debug("Raw boot image support not enabled, proceeding to other boot methods\n");
return -EINVAL;
-#endif
+ }
return 0;
}