From 7f10a7fe126dce5644d933af693eda40497d7755 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 5 Mar 2025 17:25:07 -0700 Subject: bootm: Allow building bootm.c without CONFIG_SYS_BOOTM_LEN This code cannot be compiled by boards which don't have this option. Add an accessor in the header file to avoid another #ifdef Signed-off-by: Simon Glass Reviewed-by: Quentin Schulz --- include/bootm.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/bootm.h b/include/bootm.h index c471615b08c..d174f18ac18 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -89,6 +89,14 @@ struct bootm_info { #define bootm_x86_set(_bmi, _field, _val) #endif +static inline ulong bootm_len(void) +{ +#ifdef CONFIG_SYS_BOOTM_LEN + return CONFIG_SYS_BOOTM_LEN; +#endif + return 0; +} + /** * bootm_init() - Set up a bootm_info struct with useful defaults * -- cgit v1.3.1