Skip to content

Commit 9ea40db

Browse files
MrVangregkh
authored andcommitted
tty: serial: lpuart: fix lpuart32_write usage
The 2nd and 3rd parameter were wrongly used, and cause kernel abort when doing kgdb debug. Fixes: 1da17d7 ("tty: serial: fsl_lpuart: Use appropriate lpuart32_* I/O funcs") Cc: stable <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c9ca43d commit 9ea40db

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

drivers/tty/serial/fsl_lpuart.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -649,26 +649,24 @@ static int lpuart32_poll_init(struct uart_port *port)
649649
spin_lock_irqsave(&sport->port.lock, flags);
650650

651651
/* Disable Rx & Tx */
652-
lpuart32_write(&sport->port, UARTCTRL, 0);
652+
lpuart32_write(&sport->port, 0, UARTCTRL);
653653

654654
temp = lpuart32_read(&sport->port, UARTFIFO);
655655

656656
/* Enable Rx and Tx FIFO */
657-
lpuart32_write(&sport->port, UARTFIFO,
658-
temp | UARTFIFO_RXFE | UARTFIFO_TXFE);
657+
lpuart32_write(&sport->port, temp | UARTFIFO_RXFE | UARTFIFO_TXFE, UARTFIFO);
659658

660659
/* flush Tx and Rx FIFO */
661-
lpuart32_write(&sport->port, UARTFIFO,
662-
UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH);
660+
lpuart32_write(&sport->port, UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH, UARTFIFO);
663661

664662
/* explicitly clear RDRF */
665663
if (lpuart32_read(&sport->port, UARTSTAT) & UARTSTAT_RDRF) {
666664
lpuart32_read(&sport->port, UARTDATA);
667-
lpuart32_write(&sport->port, UARTFIFO, UARTFIFO_RXUF);
665+
lpuart32_write(&sport->port, UARTFIFO_RXUF, UARTFIFO);
668666
}
669667

670668
/* Enable Rx and Tx */
671-
lpuart32_write(&sport->port, UARTCTRL, UARTCTRL_RE | UARTCTRL_TE);
669+
lpuart32_write(&sport->port, UARTCTRL_RE | UARTCTRL_TE, UARTCTRL);
672670
spin_unlock_irqrestore(&sport->port.lock, flags);
673671

674672
return 0;
@@ -677,7 +675,7 @@ static int lpuart32_poll_init(struct uart_port *port)
677675
static void lpuart32_poll_put_char(struct uart_port *port, unsigned char c)
678676
{
679677
lpuart32_wait_bit_set(port, UARTSTAT, UARTSTAT_TDRE);
680-
lpuart32_write(port, UARTDATA, c);
678+
lpuart32_write(port, c, UARTDATA);
681679
}
682680

683681
static int lpuart32_poll_get_char(struct uart_port *port)

0 commit comments

Comments
 (0)