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>
diff --git a/drivers/serial/serial_s3c24x0.c b/drivers/serial/serial_s3c24x0.c
index d4e7df2..0f0878a 100644
--- a/drivers/serial/serial_s3c24x0.c
+++ b/drivers/serial/serial_s3c24x0.c
@@ -135,14 +135,14 @@
{
struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index);
+ /* If \n, also do \r */
+ if (c == '\n')
+ serial_putc('\r');
+
while (!(readl(&uart->utrstat) & 0x2))
/* wait for room in the tx FIFO */ ;
writeb(c, &uart->utxh);
-
- /* If \n, also do \r */
- if (c == '\n')
- serial_putc('\r');
}
static inline void serial_putc_dev(unsigned int dev_index, const char c)