From: Karthikeyan Ramasubramanian Date: Thu, 3 May 2018 20:14:38 +0000 (-0600) Subject: tty: serial: qcom_geni_serial: Use iowrite32_rep to write to FIFO X-Git-Tag: v4.18-rc1~133^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=69736b57dfe57d116cac7846006cb4b0be9ac0d0;p=thirdparty%2Fkernel%2Flinux.git tty: serial: qcom_geni_serial: Use iowrite32_rep to write to FIFO Use iowrite32_rep to write to the hardware FIFO so that the code does not have to worry about the system endianness. Signed-off-by: Karthikeyan Ramasubramanian Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 3e9de6c780d30..b0758606b6762 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -600,14 +600,15 @@ static void qcom_geni_serial_handle_tx(struct uart_port *uport) remaining = chunk; for (i = 0; i < chunk; ) { unsigned int tx_bytes; - unsigned int buf = 0; + u8 buf[sizeof(u32)]; int c; + memset(buf, 0, ARRAY_SIZE(buf)); tx_bytes = min_t(size_t, remaining, port->tx_bytes_pw); for (c = 0; c < tx_bytes ; c++) - buf |= (xmit->buf[tail + c] << (c * BITS_PER_BYTE)); + buf[c] = xmit->buf[tail + c]; - writel_relaxed(buf, uport->membase + SE_GENI_TX_FIFOn); + iowrite32_rep(uport->membase + SE_GENI_TX_FIFOn, buf, 1); i += tx_bytes; tail = (tail + tx_bytes) & (UART_XMIT_SIZE - 1);