]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
expo: Drop the render from expo_poll()
authorSimon Glass <sjg@chromium.org>
Fri, 2 May 2025 14:46:52 +0000 (08:46 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 30 May 2025 08:49:32 +0000 (09:49 +0100)
Within tests it is useful to be able to control rendering of the expo.
Drop the automatic call to expo_render() within expo_poll() and adjust
its callers to handle this instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/cedit.c
boot/expo.c
cmd/bootflow.c
include/expo.h

index 8faf230a9e2adb5fb6d29ef7ffcd36a00bca3f40..56dc7c6af15b066e2c958eb9e718ee2dacc62ef8 100644 (file)
@@ -219,6 +219,10 @@ int cedit_run(struct expo *exp)
        do {
                struct expo_action act;
 
+               ret = expo_render(exp);
+               if (ret)
+                       return log_msg_ret("cer", ret);
+
                ret = expo_poll(exp, &act);
                if (!ret)
                        cedit_do_action(exp, scn, vid_priv, &act);
index ee8ffaf89204dba69fd6cb8b642b9e73ae7d9356..94413acd3816aebab82a79745221cda4258c8417 100644 (file)
@@ -320,10 +320,6 @@ int expo_poll(struct expo *exp, struct expo_action *act)
 {
        int ichar, key, ret;
 
-       ret = expo_render(exp);
-       if (ret)
-               return log_msg_ret("ere", ret);
-
        ichar = cli_ch_process(&exp->cch, 0);
        if (!ichar) {
                int i;
index efac27a5d77366aa61a19466b089ee2cf3a255a6..55643a6876f0c7a273fc4e57f3cec577bad2ae74 100644 (file)
@@ -116,6 +116,9 @@ __maybe_unused static int bootflow_handle_menu(struct bootstd_priv *std,
                return log_msg_ret("bhs", ret);
 
        do {
+               ret = expo_render(exp);
+               if (ret)
+                       return log_msg_ret("bhr", ret);
                ret = bootflow_menu_poll(exp, &bflow);
        } while (ret == -EAGAIN);
 
index dfecd6ed2395e5704cb688d376a0a7c3bbce0a27..2addddd5012cd08dbb9cb165764207215bddce7b 100644 (file)
@@ -1006,10 +1006,13 @@ int expo_build(ofnode root, struct expo **expp);
 int cb_expo_build(struct expo **expp);
 
 /**
- * expo_poll() - render an expo and see if the user takes an action
+ * expo_poll() - see if the user takes an action
  *
- * Thsi calls expo_render() and then checks for a keypress. If there is one, it
- * is processed and the resulting action returned, if any
+ * This checks for a keypress. If there is one, it is processed and the
+ * resulting action returned, if any.
+ *
+ * Note that expo_render() should normally be called immediately before this
+ * function so that the user can see the latest state.
  *
  * @exp: Expo to poll
  * @act: Returns action on success