diff options
author | Simon Glass <sjg@chromium.org> | 2023-06-01 10:22:34 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-07-14 12:54:51 -0400 |
commit | 42b18494bdaf677c4726ef47a839b16a1a3daba2 (patch) | |
tree | b07140ea3d5819b6b4ce904f6506dc0462e7d944 /boot | |
parent | 0ab4f91a107832692781a367a1ef2173af75f108 (diff) |
expo: Store the console in the expo
Rather than finding this each time, keep a pointer to it. This simplifies
the code a little.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/expo.c | 9 | ||||
-rw-r--r-- | boot/scene.c | 10 |
2 files changed, 11 insertions, 8 deletions
diff --git a/boot/expo.c b/boot/expo.c index 05950a1760..cd1b1a3de5 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -83,7 +83,16 @@ const char *expo_get_str(struct expo *exp, uint id) int expo_set_display(struct expo *exp, struct udevice *dev) { + struct udevice *cons; + int ret; + + ret = device_find_first_child_by_uclass(dev, UCLASS_VIDEO_CONSOLE, + &cons); + if (ret) + return log_msg_ret("con", ret); + exp->display = dev; + exp->cons = cons; return 0; } diff --git a/boot/scene.c b/boot/scene.c index d2f77c008c..7e9ba047f2 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -278,16 +278,10 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode) { struct scene *scn = obj->scene; struct expo *exp = scn->expo; - struct udevice *cons, *dev = exp->display; + struct udevice *dev = exp->display; + struct udevice *cons = text_mode ? NULL : exp->cons; int x, y, ret; - cons = NULL; - if (!text_mode) { - ret = device_find_first_child_by_uclass(dev, - UCLASS_VIDEO_CONSOLE, - &cons); - } - x = obj->x; y = obj->y; |