Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: 8250: Name MSR literals

Add UART_MSR_STATUS_BITS for CD, RI, DSR & CTS. Use names for the
literal.

Don't make the define for combined flags part of UAPI.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20221125130509.8482-3-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ilpo Järvinen and committed by
Greg Kroah-Hartman
d9c1d3cb ef460db2

+7 -2
+2 -2
drivers/tty/serial/8250/8250_port.c
··· 1268 1268 */ 1269 1269 if (!(port->flags & UPF_SKIP_TEST)) { 1270 1270 serial8250_out_MCR(up, UART_MCR_LOOP | 0x0A); 1271 - status1 = serial_in(up, UART_MSR) & 0xF0; 1271 + status1 = serial_in(up, UART_MSR) & UART_MSR_STATUS_BITS; 1272 1272 serial8250_out_MCR(up, save_mcr); 1273 - if (status1 != 0x90) { 1273 + if (status1 != (UART_MSR_DCD | UART_MSR_CTS)) { 1274 1274 spin_unlock_irqrestore(&port->lock, flags); 1275 1275 DEBUG_AUTOCONF("LOOP test failed (%02x) ", 1276 1276 status1);
+5
include/linux/serial.h
··· 28 28 return (lsr & UART_LSR_BOTH_EMPTY) == UART_LSR_BOTH_EMPTY; 29 29 } 30 30 31 + #define UART_MSR_STATUS_BITS (UART_MSR_DCD | \ 32 + UART_MSR_RI | \ 33 + UART_MSR_DSR | \ 34 + UART_MSR_CTS) 35 + 31 36 /* 32 37 * Counters of the input lines (CTS, DSR, RI, CD) interrupts 33 38 */