]> git.baikalelectronics.ru Git - uboot.git/commit
serial: Fix _serial_puts using \n\r instead of \r\n
authorSean Anderson <sean.anderson@seco.com>
Mon, 4 Apr 2022 18:17:57 +0000 (14:17 -0400)
committerTom Rini <trini@konsulko.com>
Thu, 14 Apr 2022 19:39:15 +0000 (15:39 -0400)
commitd8c86e344e6694b1f65c08ae903f8be0abb71828
tree7462f882c9755bc0817131774c4a06dce110ea35
parent5f4c33d0e0abd929d5eee98ba22c0a332b9d3457
serial: Fix _serial_puts using \n\r instead of \r\n

A string like "test\n" would be broken up into the following sequence of
prints by _serial_puts:

puts("test\n")
putc('\r')

Although functionally this is the same as \r\n, it is not the standard
sequence and caused tests to fail. Fix this by excluding the '\n' from
the initial print. The above string will now be broken up like

puts("test")
puts("\r\n")

Since we may now need to call ops->puts twice (with the associated retry
logic), break that part of the function off into a helper.

Fixes: 334ddafd3a ("serial: dm: Add support for puts")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
drivers/serial/serial-uclass.c