aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/lantiq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/lantiq.c')
-rw-r--r--drivers/tty/serial/lantiq.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
index 02da071fe1e7..15733da757c6 100644
--- a/drivers/tty/serial/lantiq.c
+++ b/drivers/tty/serial/lantiq.c
@@ -162,21 +162,16 @@ lqasc_enable_ms(struct uart_port *port)
162static int 162static int
163lqasc_rx_chars(struct uart_port *port) 163lqasc_rx_chars(struct uart_port *port)
164{ 164{
165 struct tty_struct *tty = tty_port_tty_get(&port->state->port); 165 struct tty_port *tport = &port->state->port;
166 unsigned int ch = 0, rsr = 0, fifocnt; 166 unsigned int ch = 0, rsr = 0, fifocnt;
167 167
168 if (!tty) { 168 fifocnt = ltq_r32(port->membase + LTQ_ASC_FSTAT) & ASCFSTAT_RXFFLMASK;
169 dev_dbg(port->dev, "%s:tty is busy now", __func__);
170 return -EBUSY;
171 }
172 fifocnt =
173 ltq_r32(port->membase + LTQ_ASC_FSTAT) & ASCFSTAT_RXFFLMASK;
174 while (fifocnt--) { 169 while (fifocnt--) {
175 u8 flag = TTY_NORMAL; 170 u8 flag = TTY_NORMAL;
176 ch = ltq_r8(port->membase + LTQ_ASC_RBUF); 171 ch = ltq_r8(port->membase + LTQ_ASC_RBUF);
177 rsr = (ltq_r32(port->membase + LTQ_ASC_STATE) 172 rsr = (ltq_r32(port->membase + LTQ_ASC_STATE)
178 & ASCSTATE_ANY) | UART_DUMMY_UER_RX; 173 & ASCSTATE_ANY) | UART_DUMMY_UER_RX;
179 tty_flip_buffer_push(tty); 174 tty_flip_buffer_push(tport);
180 port->icount.rx++; 175 port->icount.rx++;
181 176
182 /* 177 /*
@@ -208,7 +203,7 @@ lqasc_rx_chars(struct uart_port *port)
208 } 203 }
209 204
210 if ((rsr & port->ignore_status_mask) == 0) 205 if ((rsr & port->ignore_status_mask) == 0)
211 tty_insert_flip_char(tty, ch, flag); 206 tty_insert_flip_char(tport, ch, flag);
212 207
213 if (rsr & ASCSTATE_ROE) 208 if (rsr & ASCSTATE_ROE)
214 /* 209 /*
@@ -216,11 +211,12 @@ lqasc_rx_chars(struct uart_port *port)
216 * immediately, and doesn't affect the current 211 * immediately, and doesn't affect the current
217 * character 212 * character
218 */ 213 */
219 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 214 tty_insert_flip_char(tport, 0, TTY_OVERRUN);
220 } 215 }
216
221 if (ch != 0) 217 if (ch != 0)
222 tty_flip_buffer_push(tty); 218 tty_flip_buffer_push(tport);
223 tty_kref_put(tty); 219
224 return 0; 220 return 0;
225} 221}
226 222