expo: Drop the render from expo_poll()
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>
diff --git a/boot/cedit.c b/boot/cedit.c
index 8faf230..56dc7c6 100644
--- a/boot/cedit.c
+++ b/boot/cedit.c
@@ -219,6 +219,10 @@
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);
diff --git a/boot/expo.c b/boot/expo.c
index ee8ffaf..94413ac 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -320,10 +320,6 @@
{
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;
diff --git a/cmd/bootflow.c b/cmd/bootflow.c
index efac27a..55643a6 100644
--- a/cmd/bootflow.c
+++ b/cmd/bootflow.c
@@ -116,6 +116,9 @@
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);
diff --git a/include/expo.h b/include/expo.h
index dfecd6e..2addddd 100644
--- a/include/expo.h
+++ b/include/expo.h
@@ -1006,10 +1006,13 @@
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
+ *
+ * This checks for a keypress. If there is one, it is processed and the
+ * resulting action returned, if any.
*
- * Thsi calls expo_render() and then 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