mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 15:28:50 +00:00
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>
This commit is contained in:
parent
6b6dc0d2fb
commit
92fd6a1220
1 changed files with 5 additions and 4 deletions
|
@ -652,17 +652,18 @@ static int do_video_puts(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char *const argv[])
|
char *const argv[])
|
||||||
{
|
{
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
const char *s;
|
int ret;
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
|
|
||||||
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
|
if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
|
||||||
return CMD_RET_FAILURE;
|
return CMD_RET_FAILURE;
|
||||||
for (s = argv[1]; *s; s++)
|
ret = vidconsole_put_string(dev, argv[1]);
|
||||||
vidconsole_put_char(dev, *s);
|
if (!ret)
|
||||||
|
ret = video_sync(dev->parent, false);
|
||||||
|
|
||||||
return video_sync(dev->parent, false);
|
return ret ? CMD_RET_FAILURE : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
U_BOOT_CMD(
|
U_BOOT_CMD(
|
||||||
|
|
Loading…
Add table
Reference in a new issue