diff options
author | Marek Vasut <marex@denx.de> | 2019-05-17 21:22:31 +0300 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2019-05-20 13:00:05 +0300 |
commit | e63168a9ffae18f807f59925bb5d9d4623633e46 (patch) | |
tree | 7dfc643cd5bb6cccc7725870098c36f25216b29c /drivers/video | |
parent | b5e1a82e924d18d4134757e39a1f26e473f80e0b (diff) | |
download | u-boot-e63168a9ffae18f807f59925bb5d9d4623633e46.tar.xz |
video: Factor out vidconsole_put_string()
Pull the vidconsole_put_string() function from DM tests, make it
available to e.g. boards that want to display information on the
LCD on boot.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index c31303b56e..af88588904 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -529,6 +529,20 @@ int vidconsole_put_char(struct udevice *dev, char ch) return 0; } +int vidconsole_put_string(struct udevice *dev, const char *str) +{ + const char *s; + int ret; + + for (s = str; *s; s++) { + ret = vidconsole_put_char(dev, *s); + if (ret) + return ret; + } + + return 0; +} + static void vidconsole_putc(struct stdio_dev *sdev, const char ch) { struct udevice *dev = sdev->priv; @@ -541,8 +555,7 @@ static void vidconsole_puts(struct stdio_dev *sdev, const char *s) { struct udevice *dev = sdev->priv; - while (*s) - vidconsole_put_char(dev, *s++); + vidconsole_put_string(dev, s); video_sync(dev->parent, false); } |