diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2019-11-28 15:55:39 +0100 |
---|---|---|
committer | Li Yang <leoyang.li@nxp.com> | 2019-12-09 13:54:35 -0600 |
commit | 09a39ec9decd99ef4dfaa21a83ce09f719495b49 (patch) | |
tree | cfb85dd36bc08db556213616e7dcf283b835ed60 /drivers/tty/serial/ucc_uart.c | |
parent | b0816f88b9b5a829401a1473e51c7001940d616f (diff) | |
download | linux-stable-09a39ec9decd99ef4dfaa21a83ce09f719495b49.tar.gz linux-stable-09a39ec9decd99ef4dfaa21a83ce09f719495b49.tar.bz2 linux-stable-09a39ec9decd99ef4dfaa21a83ce09f719495b49.zip |
serial: ucc_uart: access __be32 field using be32_to_cpu
The buf member of struct qe_bd is a __be32, so to make this work on
little-endian hosts, use be32_to_cpu when reading it.
Reviewed-by: Timur Tabi <timur@kernel.org>
Acked-by: Timur Tabi <timur@kernel.org>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Diffstat (limited to 'drivers/tty/serial/ucc_uart.c')
-rw-r--r-- | drivers/tty/serial/ucc_uart.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index 9436b93d5cfa..afc2a5d69202 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -343,7 +343,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port) /* Pick next descriptor and fill from buffer */ bdp = qe_port->tx_cur; - p = qe2cpu_addr(bdp->buf, qe_port); + p = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port); *p++ = port->x_char; qe_iowrite16be(1, &bdp->length); @@ -371,7 +371,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port) while (!(qe_ioread16be(&bdp->status) & BD_SC_READY) && (xmit->tail != xmit->head)) { count = 0; - p = qe2cpu_addr(bdp->buf, qe_port); + p = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port); while (count < qe_port->tx_fifosize) { *p++ = xmit->buf[xmit->tail]; xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); @@ -491,7 +491,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port) } /* get pointer */ - cp = qe2cpu_addr(bdp->buf, qe_port); + cp = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port); /* loop through the buffer */ while (i-- > 0) { |