mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
spl: Drop the switch() statement for OS selection
This code is pretty ugly, with many #ifdefs There are quite a lot of IH_OS_U_BOOT values so the compiler struggles to create a jump table here. Also, most of the options are normally disabled. Change it to an else...if construct instead. Add an accessor for the spl_image field behind an #ifdef to avoid needing #ifdef in the C code. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -263,6 +263,15 @@ struct spl_image_info {
|
||||
#endif
|
||||
};
|
||||
|
||||
static inline void *spl_image_fdt_addr(struct spl_image_info *info)
|
||||
{
|
||||
#if CONFIG_IS_ENABLED(LOAD_FIT) || CONFIG_IS_ENABLED(LOAD_FIT_FULL)
|
||||
return info->fdt_addr;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Information required to load data from a device
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user