diff options
author | Alison Wang <b18965@freescale.com> | 2016-03-02 11:00:37 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-03-14 15:34:50 -0600 |
commit | 055457ef25357d1921a8ed13ebfd32c526f12106 (patch) | |
tree | c97826f8e0ad88c7e486b4cdae2cda56d3495621 /drivers/serial/usbtty.c | |
parent | c5917b4b054d60c6c495f06b0538afed39dfe343 (diff) |
serial: Move carriage return before line feed for some serial drivers
In general, a carriage return needs to execute before a line feed.
The patch is to change some serial drivers based on this rule, such
as serial_mxc.c, serial_pxa.c, serial_s3c24x0.c and usbtty.c.
Signed-off-by: Alison Wang <alison.wang@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/serial/usbtty.c')
-rw-r--r-- | drivers/serial/usbtty.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c index 75f0ec31bb..2e19813643 100644 --- a/drivers/serial/usbtty.c +++ b/drivers/serial/usbtty.c @@ -434,11 +434,12 @@ void usbtty_putc(struct stdio_dev *dev, const char c) if (!usbtty_configured ()) return; - buf_push (&usbtty_output, &c, 1); /* If \n, also do \r */ if (c == '\n') buf_push (&usbtty_output, "\r", 1); + buf_push(&usbtty_output, &c, 1); + /* Poll at end to handle new data... */ if ((usbtty_output.size + 2) >= usbtty_output.totalsize) { usbtty_poll (); @@ -498,8 +499,8 @@ void usbtty_puts(struct stdio_dev *dev, const char *str) n = next_nl_pos (str); if (str[n] == '\n') { - __usbtty_puts (str, n + 1); - __usbtty_puts ("\r", 1); + __usbtty_puts("\r", 1); + __usbtty_puts(str, n + 1); str += (n + 1); len -= (n + 1); } else { |