diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2014-05-29 04:48:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-29 14:28:05 -0400 |
commit | 2fe686ebafb43414c406c4c6252ad388a871bf1a (patch) | |
tree | 7b2007bff57441d3e012bd372cd711e36544f207 | |
parent | 58eb97c99da6a82c556ddec70683eb3863d4f617 (diff) |
serial: cpm_uart: No LF conversion in put_poll_char()
In (c7d44a02a 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: Daniel 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/cpm_uart/cpm_uart_core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index 7d76214612c7..aa60e6d13eca 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c | |||
@@ -971,7 +971,7 @@ static void cpm_uart_config_port(struct uart_port *port, int flags) | |||
971 | * Note that this is called with interrupts already disabled | 971 | * Note that this is called with interrupts already disabled |
972 | */ | 972 | */ |
973 | static void cpm_uart_early_write(struct uart_cpm_port *pinfo, | 973 | static void cpm_uart_early_write(struct uart_cpm_port *pinfo, |
974 | const char *string, u_int count) | 974 | const char *string, u_int count, bool handle_linefeed) |
975 | { | 975 | { |
976 | unsigned int i; | 976 | unsigned int i; |
977 | cbd_t __iomem *bdp, *bdbase; | 977 | cbd_t __iomem *bdp, *bdbase; |
@@ -1013,7 +1013,7 @@ static void cpm_uart_early_write(struct uart_cpm_port *pinfo, | |||
1013 | bdp++; | 1013 | bdp++; |
1014 | 1014 | ||
1015 | /* if a LF, also do CR... */ | 1015 | /* if a LF, also do CR... */ |
1016 | if (*string == 10) { | 1016 | if (handle_linefeed && *string == 10) { |
1017 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) | 1017 | while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0) |
1018 | ; | 1018 | ; |
1019 | 1019 | ||
@@ -1111,7 +1111,7 @@ static void cpm_put_poll_char(struct uart_port *port, | |||
1111 | static char ch[2]; | 1111 | static char ch[2]; |
1112 | 1112 | ||
1113 | ch[0] = (char)c; | 1113 | ch[0] = (char)c; |
1114 | cpm_uart_early_write(pinfo, ch, 1); | 1114 | cpm_uart_early_write(pinfo, ch, 1, false); |
1115 | } | 1115 | } |
1116 | #endif /* CONFIG_CONSOLE_POLL */ | 1116 | #endif /* CONFIG_CONSOLE_POLL */ |
1117 | 1117 | ||
@@ -1275,7 +1275,7 @@ static void cpm_uart_console_write(struct console *co, const char *s, | |||
1275 | spin_lock_irqsave(&pinfo->port.lock, flags); | 1275 | spin_lock_irqsave(&pinfo->port.lock, flags); |
1276 | } | 1276 | } |
1277 | 1277 | ||
1278 | cpm_uart_early_write(pinfo, s, count); | 1278 | cpm_uart_early_write(pinfo, s, count, true); |
1279 | 1279 | ||
1280 | if (unlikely(nolock)) { | 1280 | if (unlikely(nolock)) { |
1281 | local_irq_restore(flags); | 1281 | local_irq_restore(flags); |