summaryrefslogtreecommitdiff
path: root/drivers/serial/serial_pxa.c
diff options
context:
space:
mode:
authorAlison Wang <b18965@freescale.com>2016-03-02 11:00:37 +0800
committerSimon Glass <sjg@chromium.org>2016-03-14 15:34:50 -0600
commit055457ef25357d1921a8ed13ebfd32c526f12106 (patch)
treec97826f8e0ad88c7e486b4cdae2cda56d3495621 /drivers/serial/serial_pxa.c
parentc5917b4b054d60c6c495f06b0538afed39dfe343 (diff)
downloadu-boot-imx-055457ef25357d1921a8ed13ebfd32c526f12106.zip
u-boot-imx-055457ef25357d1921a8ed13ebfd32c526f12106.tar.gz
u-boot-imx-055457ef25357d1921a8ed13ebfd32c526f12106.tar.bz2
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/serial_pxa.c')
-rw-r--r--drivers/serial/serial_pxa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/serial/serial_pxa.c b/drivers/serial/serial_pxa.c
index 8fbcc10..1eb19ec 100644
--- a/drivers/serial/serial_pxa.c
+++ b/drivers/serial/serial_pxa.c
@@ -156,6 +156,10 @@ void pxa_putc_dev(unsigned int uart_index, const char c)
{
struct pxa_uart_regs *uart_regs;
+ /* If \n, also do \r */
+ if (c == '\n')
+ pxa_putc_dev(uart_index, '\r');
+
uart_regs = pxa_uart_index_to_regs(uart_index);
if (!uart_regs)
hang();
@@ -163,10 +167,6 @@ void pxa_putc_dev(unsigned int uart_index, const char c)
while (!(readl(&uart_regs->lsr) & LSR_TEMT))
WATCHDOG_RESET();
writel(c, &uart_regs->thr);
-
- /* If \n, also do \r */
- if (c == '\n')
- pxa_putc_dev (uart_index,'\r');
}
/*