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 <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
diff --git a/include/bootm.h b/include/bootm.h
index c471615..d174f18 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -89,6 +89,14 @@
#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
*