提交 2fe686eb 编写于 作者: D Daniel Thompson 提交者: Greg Kroah-Hartman

serial: cpm_uart: No LF conversion in put_poll_char()

In (c7d44a02 serial_core: Commonalize crlf when working w/ a non open
console port) the core was modified to make the UART poll_put_char()
automatically convert LF to CRLF. This driver's poll_put_char() adds a
CR itself and this was not disabled by the above patch meaning
currently it sends two CR characters.

The code to issue a character is shared by the console write code (where
driver must do LF to CRLF conversion, although it can make use of the
uart_console_write() helper function) and the poll_put_char (where
driver must not do the conversion). For that reason we add a flag rather
than simply rip out the conversion code.
Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
Cc: Doug Anderson <dianders@chromium.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 58eb97c9
...@@ -971,7 +971,7 @@ static void cpm_uart_config_port(struct uart_port *port, int flags) ...@@ -971,7 +971,7 @@ static void cpm_uart_config_port(struct uart_port *port, int flags)
* Note that this is called with interrupts already disabled * Note that this is called with interrupts already disabled
*/ */
static void cpm_uart_early_write(struct uart_cpm_port *pinfo, static void cpm_uart_early_write(struct uart_cpm_port *pinfo,
const char *string, u_int count) const char *string, u_int count, bool handle_linefeed)
{ {
unsigned int i; unsigned int i;
cbd_t __iomem *bdp, *bdbase; cbd_t __iomem *bdp, *bdbase;
...@@ -1013,7 +1013,7 @@ static void cpm_uart_early_write(struct uart_cpm_port *pinfo, ...@@ -1013,7 +1013,7 @@ static void cpm_uart_early_write(struct uart_cpm_port *pinfo,
bdp++; bdp++;
/* if a LF, also do CR... */ /* if a LF, also do CR... */
if (*string == 10) { if (handle_linefeed && *string == 10) {
while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
; ;
...@@ -1111,7 +1111,7 @@ static void cpm_put_poll_char(struct uart_port *port, ...@@ -1111,7 +1111,7 @@ static void cpm_put_poll_char(struct uart_port *port,
static char ch[2]; static char ch[2];
ch[0] = (char)c; ch[0] = (char)c;
cpm_uart_early_write(pinfo, ch, 1); cpm_uart_early_write(pinfo, ch, 1, false);
} }
#endif /* CONFIG_CONSOLE_POLL */ #endif /* CONFIG_CONSOLE_POLL */
...@@ -1275,7 +1275,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, ...@@ -1275,7 +1275,7 @@ static void cpm_uart_console_write(struct console *co, const char *s,
spin_lock_irqsave(&pinfo->port.lock, flags); spin_lock_irqsave(&pinfo->port.lock, flags);
} }
cpm_uart_early_write(pinfo, s, count); cpm_uart_early_write(pinfo, s, count, true);
if (unlikely(nolock)) { if (unlikely(nolock)) {
local_irq_restore(flags); local_irq_restore(flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册