From: Simon Glass Date: Thu, 6 Oct 2022 14:36:05 +0000 (-0600) Subject: video: Use vidconsole_put_string() to write a string X-Git-Tag: v2025.01-rc5-pxa1908~1229^2~54 X-Git-Url: http://git.dujemihanovic.xyz/html/index.html?a=commitdiff_plain;h=92fd6a12206718948ba0f8f8bf1db89f6f73112c;p=u-boot.git 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 --- diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 53263580e3..d5667191e0 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(