From da754e20c99a0e611b05c74f9e28daf9cdf1a199 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 May 2025 08:46:28 -0600 Subject: expo: Split bootflow_menu_new() into two pieces Split the iteration piece of this function into bootflow_menu_add_all() so that it is possible for the caller to be in control of adding items to the menu. Move the expo_destroy() call into the caller. Signed-off-by: Simon Glass --- include/bootflow.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/bootflow.h b/include/bootflow.h index 8244d4fca18..994b38394e8 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -488,11 +488,24 @@ int bootflow_iter_check_system(const struct bootflow_iter *iter); /** * bootflow_menu_new() - Create a new bootflow menu * + * This is initially empty. Call bootflow_menu_add_all() to add all the + * bootflows to it. + * * @expp: Returns the expo created * Returns 0 on success, -ve on error */ int bootflow_menu_new(struct expo **expp); +/** + * bootflow_menu_add_all() - Add all bootflows to a menu + * + * Loops through all bootflows and adds them to the menu + * + * @exp: Menu to update + * Return 0 on success, -ve on error + */ +int bootflow_menu_add_all(struct expo *exp); + /** * bootflow_menu_apply_theme() - Apply a theme to a bootmenu * -- cgit v1.3.1