diff options
author | Simon Glass <sjg@chromium.org> | 2022-10-06 08:36:05 -0600 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2022-10-30 09:56:02 +0100 |
commit | 92fd6a12206718948ba0f8f8bf1db89f6f73112c (patch) | |
tree | 8e397392f1774ea3b6c992da04c1ab7bd3d8abbc /drivers | |
parent | 6b6dc0d2fbf8b036d7ee278071036c7479074b32 (diff) | |
download | u-boot-92fd6a12206718948ba0f8f8bf1db89f6f73112c.tar.gz |
video: Use vidconsole_put_string() to write a string
Use the existing function rather that duplicating the code. Also fix up
the missing error handling.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 53263580e3b..d5667191e0a 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -652,17 +652,18 @@ static int do_video_puts(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct udevice *dev; - const char *s; + int ret; if (argc != 2) return CMD_RET_USAGE; if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev)) return CMD_RET_FAILURE; - for (s = argv[1]; *s; s++) - vidconsole_put_char(dev, *s); + ret = vidconsole_put_string(dev, argv[1]); + if (!ret) + ret = video_sync(dev->parent, false); - return video_sync(dev->parent, false); + return ret ? CMD_RET_FAILURE : 0; } U_BOOT_CMD( |