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

serial: 8250: use serial_port_in/out() helpers

There are serial_port_in/out() helpers to be used instead of direct
p->serial_in/out(). Use them in various 8250 drivers.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

--
[v2]
* Use serial_port_in/out() and not serial_in/out() [Andy]

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # 8250_dw
Link: https://lore.kernel.org/r/20250317070046.24386-28-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
dbd26a88 1e657d66

+13 -13
+8 -8
drivers/tty/serial/8250/8250_dw.c
··· 120 120 * enabled. 121 121 */ 122 122 if (up->fcr & UART_FCR_ENABLE_FIFO) { 123 - lsr = p->serial_in(p, UART_LSR); 123 + lsr = serial_port_in(p, UART_LSR); 124 124 if (!(lsr & UART_LSR_DR)) 125 125 return; 126 126 } 127 127 128 - (void)p->serial_in(p, UART_RX); 128 + serial_port_in(p, UART_RX); 129 129 } 130 130 131 131 static void dw8250_check_lcr(struct uart_port *p, int offset, int value) ··· 139 139 140 140 /* Make sure LCR write wasn't ignored */ 141 141 while (tries--) { 142 - unsigned int lcr = p->serial_in(p, offset); 142 + unsigned int lcr = serial_port_in(p, offset); 143 143 144 144 if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR)) 145 145 return; ··· 260 260 { 261 261 struct uart_8250_port *up = up_to_u8250p(p); 262 262 struct dw8250_data *d = to_dw8250_data(p->private_data); 263 - unsigned int iir = p->serial_in(p, UART_IIR); 263 + unsigned int iir = serial_port_in(p, UART_IIR); 264 264 bool rx_timeout = (iir & 0x3f) == UART_IIR_RX_TIMEOUT; 265 265 unsigned int quirks = d->pdata->quirks; 266 266 unsigned int status; ··· 281 281 status = serial_lsr_in(up); 282 282 283 283 if (!(status & (UART_LSR_DR | UART_LSR_BI))) 284 - (void) p->serial_in(p, UART_RX); 284 + serial_port_in(p, UART_RX); 285 285 286 286 uart_port_unlock_irqrestore(p, flags); 287 287 } ··· 303 303 304 304 if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) { 305 305 /* Clear the USR */ 306 - (void)p->serial_in(p, d->pdata->usr_reg); 306 + serial_port_in(p, d->pdata->usr_reg); 307 307 308 308 return 1; 309 309 } ··· 390 390 static void dw8250_set_ldisc(struct uart_port *p, struct ktermios *termios) 391 391 { 392 392 struct uart_8250_port *up = up_to_u8250p(p); 393 - unsigned int mcr = p->serial_in(p, UART_MCR); 393 + unsigned int mcr = serial_port_in(p, UART_MCR); 394 394 395 395 if (up->capabilities & UART_CAP_IRDA) { 396 396 if (termios->c_line == N_IRDA) ··· 398 398 else 399 399 mcr &= ~DW_UART_MCR_SIRE; 400 400 401 - p->serial_out(p, UART_MCR, mcr); 401 + serial_port_out(p, UART_MCR, mcr); 402 402 } 403 403 serial8250_do_set_ldisc(p, termios); 404 404 }
+4 -4
drivers/tty/serial/8250/8250_fsl.c
··· 32 32 33 33 uart_port_lock_irqsave(&up->port, &flags); 34 34 35 - iir = port->serial_in(port, UART_IIR); 35 + iir = serial_port_in(port, UART_IIR); 36 36 if (iir & UART_IIR_NO_INT) { 37 37 uart_port_unlock_irqrestore(&up->port, flags); 38 38 return 0; ··· 54 54 if (unlikely((iir & UART_IIR_ID) == UART_IIR_RLSI && 55 55 (up->lsr_saved_flags & UART_LSR_BI))) { 56 56 up->lsr_saved_flags &= ~UART_LSR_BI; 57 - port->serial_in(port, UART_RX); 57 + serial_port_in(port, UART_RX); 58 58 uart_port_unlock_irqrestore(&up->port, flags); 59 59 return 1; 60 60 } 61 61 62 - lsr = orig_lsr = up->port.serial_in(&up->port, UART_LSR); 62 + lsr = orig_lsr = serial_port_in(port, UART_LSR); 63 63 64 64 /* Process incoming characters first */ 65 65 if ((lsr & (UART_LSR_DR | UART_LSR_BI)) && ··· 71 71 if ((orig_lsr & UART_LSR_OE) && (up->overrun_backoff_time_ms > 0)) { 72 72 unsigned long delay; 73 73 74 - up->ier = port->serial_in(port, UART_IER); 74 + up->ier = serial_port_in(port, UART_IER); 75 75 if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { 76 76 port->ops->stop_rx(port); 77 77 } else {
+1 -1
drivers/tty/serial/8250/8250_omap.c
··· 692 692 693 693 /* Synchronize UART_IER access against the console. */ 694 694 uart_port_lock(port); 695 - up->ier = port->serial_in(port, UART_IER); 695 + up->ier = serial_port_in(port, UART_IER); 696 696 if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { 697 697 port->ops->stop_rx(port); 698 698 } else {