Skip to contentSkip to conversation

serial: 8250: Use UART_LCR_WLEN8 instead of literal

PATCH In review Ilpo Järvinen 2 participants 4 messages Jun 13, 2022 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 serial: 8250: Use UART_LCR_WLEN8 instead of literal

Use UART_LCR_WLEN8 instead of literal 0x03 in size_fifo().

---
 drivers/tty/serial/8250/8250_port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_port.c +1 -1
index 953b0fadfd4c..8365c7ad3576 100644
@@ -843,7 +843,7 @@ static int size_fifo(struct uart_8250_port *up)
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
 	old_dl = serial_dl_read(up);
 	serial_dl_write(up, 0x0001);
-	serial_out(up, UART_LCR, 0x03);
+	serial_out(up, UART_LCR, UART_LCR_WLEN8);
 	for (count = 0; count < 256; count++)
 		serial_out(up, UART_TX, count);
 	mdelay(20);/* FIXME - schedule_timeout */
Signature · 1 line
2.30.2
#1 lore raw

PATCH 2/2 serial: 8250_pericom: Use UART_LCR_DLAB

Use UART_LCR_DLAB instead of literal.

---
 drivers/tty/serial/8250/8250_pericom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_pericom.c +1 -1
index 95ff10f25d58..b8d5b7714a9d 100644
@@ -73,7 +73,7 @@ static void pericom_do_set_divisor(struct uart_port *port, unsigned int baud,
 			struct uart_8250_port *up = up_to_u8250p(port);
 			int lcr = serial_port_in(port, UART_LCR);
 
-			serial_port_out(port, UART_LCR, lcr | 0x80);
+			serial_port_out(port, UART_LCR, lcr | UART_LCR_DLAB);
 			serial_dl_write(up, divisor);
 			serial_port_out(port, 2, 16 - scr);
 			serial_port_out(port, UART_LCR, lcr);
Signature · 1 line
2.30.2
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] serial: 8250_pericom: Use UART_LCR_DLAB

Quoted 3 lines · Ilpo Järvinen

Use UART_LCR_DLAB instead of literal.

Quoted 17 lines
---
  drivers/tty/serial/8250/8250_pericom.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_pericom.c +1 -1
index 95ff10f25d58..b8d5b7714a9d 100644
@@ -73,7 +73,7 @@ static void pericom_do_set_divisor(struct uart_port *port, unsigned int baud,
  			struct uart_8250_port *up = up_to_u8250p(port);
  			int lcr = serial_port_in(port, UART_LCR);
 
-			serial_port_out(port, UART_LCR, lcr | 0x80);
+			serial_port_out(port, UART_LCR, lcr | UART_LCR_DLAB);
  			serial_dl_write(up, divisor);
  			serial_port_out(port, 2, 16 - scr);
  			serial_port_out(port, UART_LCR, lcr);
Signature · 2 lines
js
suse labs
maintainer Reviewed-by on v1 1/2
#3 lore raw
In reply to Ilpo Järvinen
Quoted 3 lines · Ilpo Järvinen

Use UART_LCR_WLEN8 instead of literal 0x03 in size_fifo().

Quoted 17 lines
---
  drivers/tty/serial/8250/8250_port.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_port.c +1 -1
index 953b0fadfd4c..8365c7ad3576 100644
@@ -843,7 +843,7 @@ static int size_fifo(struct uart_8250_port *up)
  	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
  	old_dl = serial_dl_read(up);
  	serial_dl_write(up, 0x0001);
-	serial_out(up, UART_LCR, 0x03);
+	serial_out(up, UART_LCR, UART_LCR_WLEN8);
  	for (count = 0; count < 256; count++)
  		serial_out(up, UART_TX, count);
  	mdelay(20);/* FIXME - schedule_timeout */
Signature · 2 lines
js
suse labs