Skip to content

Commit dbd26a8

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
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) <[email protected]> Cc: "Ilpo Järvinen" <[email protected]> Cc: Andy Shevchenko <[email protected]> -- [v2] * Use serial_port_in/out() and not serial_in/out() [Andy] Reviewed-by: Andy Shevchenko <[email protected]> # 8250_dw Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1e657d6 commit dbd26a8

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

drivers/tty/serial/8250/8250_dw.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ static void dw8250_force_idle(struct uart_port *p)
120120
* enabled.
121121
*/
122122
if (up->fcr & UART_FCR_ENABLE_FIFO) {
123-
lsr = p->serial_in(p, UART_LSR);
123+
lsr = serial_port_in(p, UART_LSR);
124124
if (!(lsr & UART_LSR_DR))
125125
return;
126126
}
127127

128-
(void)p->serial_in(p, UART_RX);
128+
serial_port_in(p, UART_RX);
129129
}
130130

131131
static void dw8250_check_lcr(struct uart_port *p, int offset, int value)
@@ -139,7 +139,7 @@ static void dw8250_check_lcr(struct uart_port *p, int offset, int value)
139139

140140
/* Make sure LCR write wasn't ignored */
141141
while (tries--) {
142-
unsigned int lcr = p->serial_in(p, offset);
142+
unsigned int lcr = serial_port_in(p, offset);
143143

144144
if ((value & ~UART_LCR_SPAR) == (lcr & ~UART_LCR_SPAR))
145145
return;
@@ -260,7 +260,7 @@ static int dw8250_handle_irq(struct uart_port *p)
260260
{
261261
struct uart_8250_port *up = up_to_u8250p(p);
262262
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);
264264
bool rx_timeout = (iir & 0x3f) == UART_IIR_RX_TIMEOUT;
265265
unsigned int quirks = d->pdata->quirks;
266266
unsigned int status;
@@ -281,7 +281,7 @@ static int dw8250_handle_irq(struct uart_port *p)
281281
status = serial_lsr_in(up);
282282

283283
if (!(status & (UART_LSR_DR | UART_LSR_BI)))
284-
(void) p->serial_in(p, UART_RX);
284+
serial_port_in(p, UART_RX);
285285

286286
uart_port_unlock_irqrestore(p, flags);
287287
}
@@ -303,7 +303,7 @@ static int dw8250_handle_irq(struct uart_port *p)
303303

304304
if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) {
305305
/* Clear the USR */
306-
(void)p->serial_in(p, d->pdata->usr_reg);
306+
serial_port_in(p, d->pdata->usr_reg);
307307

308308
return 1;
309309
}
@@ -390,15 +390,15 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
390390
static void dw8250_set_ldisc(struct uart_port *p, struct ktermios *termios)
391391
{
392392
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);
394394

395395
if (up->capabilities & UART_CAP_IRDA) {
396396
if (termios->c_line == N_IRDA)
397397
mcr |= DW_UART_MCR_SIRE;
398398
else
399399
mcr &= ~DW_UART_MCR_SIRE;
400400

401-
p->serial_out(p, UART_MCR, mcr);
401+
serial_port_out(p, UART_MCR, mcr);
402402
}
403403
serial8250_do_set_ldisc(p, termios);
404404
}

drivers/tty/serial/8250/8250_fsl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int fsl8250_handle_irq(struct uart_port *port)
3232

3333
uart_port_lock_irqsave(&up->port, &flags);
3434

35-
iir = port->serial_in(port, UART_IIR);
35+
iir = serial_port_in(port, UART_IIR);
3636
if (iir & UART_IIR_NO_INT) {
3737
uart_port_unlock_irqrestore(&up->port, flags);
3838
return 0;
@@ -54,12 +54,12 @@ int fsl8250_handle_irq(struct uart_port *port)
5454
if (unlikely((iir & UART_IIR_ID) == UART_IIR_RLSI &&
5555
(up->lsr_saved_flags & UART_LSR_BI))) {
5656
up->lsr_saved_flags &= ~UART_LSR_BI;
57-
port->serial_in(port, UART_RX);
57+
serial_port_in(port, UART_RX);
5858
uart_port_unlock_irqrestore(&up->port, flags);
5959
return 1;
6060
}
6161

62-
lsr = orig_lsr = up->port.serial_in(&up->port, UART_LSR);
62+
lsr = orig_lsr = serial_port_in(port, UART_LSR);
6363

6464
/* Process incoming characters first */
6565
if ((lsr & (UART_LSR_DR | UART_LSR_BI)) &&
@@ -71,7 +71,7 @@ int fsl8250_handle_irq(struct uart_port *port)
7171
if ((orig_lsr & UART_LSR_OE) && (up->overrun_backoff_time_ms > 0)) {
7272
unsigned long delay;
7373

74-
up->ier = port->serial_in(port, UART_IER);
74+
up->ier = serial_port_in(port, UART_IER);
7575
if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) {
7676
port->ops->stop_rx(port);
7777
} else {

drivers/tty/serial/8250/8250_omap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id)
692692

693693
/* Synchronize UART_IER access against the console. */
694694
uart_port_lock(port);
695-
up->ier = port->serial_in(port, UART_IER);
695+
up->ier = serial_port_in(port, UART_IER);
696696
if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) {
697697
port->ops->stop_rx(port);
698698
} else {

0 commit comments

Comments
 (0)