aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/m32r_sio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/m32r_sio.c')
-rw-r--r--drivers/serial/m32r_sio.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
index b0ecc7537ce5..b48066a64a7d 100644
--- a/drivers/serial/m32r_sio.c
+++ b/drivers/serial/m32r_sio.c
@@ -331,17 +331,12 @@ static _INLINE_ void receive_chars(struct uart_sio_port *up, int *status,
331{ 331{
332 struct tty_struct *tty = up->port.info->tty; 332 struct tty_struct *tty = up->port.info->tty;
333 unsigned char ch; 333 unsigned char ch;
334 unsigned char flag;
334 int max_count = 256; 335 int max_count = 256;
335 336
336 do { 337 do {
337 if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
338 tty->flip.work.func((void *)tty);
339 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
340 return; // if TTY_DONT_FLIP is set
341 }
342 ch = sio_in(up, SIORXB); 338 ch = sio_in(up, SIORXB);
343 *tty->flip.char_buf_ptr = ch; 339 flag = TTY_NORMAL;
344 *tty->flip.flag_buf_ptr = TTY_NORMAL;
345 up->port.icount.rx++; 340 up->port.icount.rx++;
346 341
347 if (unlikely(*status & (UART_LSR_BI | UART_LSR_PE | 342 if (unlikely(*status & (UART_LSR_BI | UART_LSR_PE |
@@ -380,30 +375,24 @@ static _INLINE_ void receive_chars(struct uart_sio_port *up, int *status,
380 375
381 if (*status & UART_LSR_BI) { 376 if (*status & UART_LSR_BI) {
382 DEBUG_INTR("handling break...."); 377 DEBUG_INTR("handling break....");
383 *tty->flip.flag_buf_ptr = TTY_BREAK; 378 flag = TTY_BREAK;
384 } else if (*status & UART_LSR_PE) 379 } else if (*status & UART_LSR_PE)
385 *tty->flip.flag_buf_ptr = TTY_PARITY; 380 flag = TTY_PARITY;
386 else if (*status & UART_LSR_FE) 381 else if (*status & UART_LSR_FE)
387 *tty->flip.flag_buf_ptr = TTY_FRAME; 382 flag = TTY_FRAME;
388 } 383 }
389 if (uart_handle_sysrq_char(&up->port, ch, regs)) 384 if (uart_handle_sysrq_char(&up->port, ch, regs))
390 goto ignore_char; 385 goto ignore_char;
391 if ((*status & up->port.ignore_status_mask) == 0) { 386 if ((*status & up->port.ignore_status_mask) == 0)
392 tty->flip.flag_buf_ptr++; 387 tty_insert_flip_char(tty, ch, flag);
393 tty->flip.char_buf_ptr++; 388
394 tty->flip.count++; 389 if (*status & UART_LSR_OE) {
395 }
396 if ((*status & UART_LSR_OE) &&
397 tty->flip.count < TTY_FLIPBUF_SIZE) {
398 /* 390 /*
399 * Overrun is special, since it's reported 391 * Overrun is special, since it's reported
400 * immediately, and doesn't affect the current 392 * immediately, and doesn't affect the current
401 * character. 393 * character.
402 */ 394 */
403 *tty->flip.flag_buf_ptr = TTY_OVERRUN; 395 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
404 tty->flip.flag_buf_ptr++;
405 tty->flip.char_buf_ptr++;
406 tty->flip.count++;
407 } 396 }
408 ignore_char: 397 ignore_char:
409 *status = serial_in(up, UART_LSR); 398 *status = serial_in(up, UART_LSR);