From: Pali Rohár Date: Sun, 7 Feb 2021 13:50:01 +0000 (+0100) Subject: serial: usbtty: Fix puts function X-Git-Tag: v2025.01-rc5-pxa1908~1977^2~16 X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=d3fb8fee7d8225845cedfd0b9d23b2a8d6f8c6ee;p=u-boot.git serial: usbtty: Fix puts function This function has incorrect implementation of prepending CR prior LF. Without this patch it prepended CR prior whole string which is going to be written and let LF without leading CR. Fix this issue by inserting CR at correct place to make output on usbtty serial console more readable. Signed-off-by: Pali Rohár Reviewed-by: Lukasz Majewski Acked-by: Pavel Machek --- diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index f1c1a260da..02f8edf200 100644 --- a/drivers/serial/usbtty.c +++ b/drivers/serial/usbtty.c @@ -500,8 +500,8 @@ void usbtty_puts(struct stdio_dev *dev, const char *str) n = next_nl_pos (str); if (str[n] == '\n') { - __usbtty_puts("\r", 1); - __usbtty_puts(str, n + 1); + __usbtty_puts(str, n); + __usbtty_puts("\r\n", 2); str += (n + 1); len -= (n + 1); } else {