diff options
Diffstat (limited to 'drivers/serial/sunzilog.c')
-rw-r--r-- | drivers/serial/sunzilog.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 7653d6cf05af..3c72484adea7 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c | |||
@@ -319,7 +319,7 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up, | |||
319 | struct pt_regs *regs) | 319 | struct pt_regs *regs) |
320 | { | 320 | { |
321 | struct tty_struct *tty; | 321 | struct tty_struct *tty; |
322 | unsigned char ch, r1; | 322 | unsigned char ch, r1, flag; |
323 | 323 | ||
324 | tty = NULL; | 324 | tty = NULL; |
325 | if (up->port.info != NULL && /* Unopened serial console */ | 325 | if (up->port.info != NULL && /* Unopened serial console */ |
@@ -362,19 +362,8 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up, | |||
362 | continue; | 362 | continue; |
363 | } | 363 | } |
364 | 364 | ||
365 | if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { | ||
366 | tty->flip.work.func((void *)tty); | ||
367 | /* | ||
368 | * The 8250 bails out of the loop here, | ||
369 | * but we need to read everything, or die. | ||
370 | */ | ||
371 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) | ||
372 | continue; | ||
373 | } | ||
374 | |||
375 | /* A real serial line, record the character and status. */ | 365 | /* A real serial line, record the character and status. */ |
376 | *tty->flip.char_buf_ptr = ch; | 366 | flag = TTY_NORMAL; |
377 | *tty->flip.flag_buf_ptr = TTY_NORMAL; | ||
378 | up->port.icount.rx++; | 367 | up->port.icount.rx++; |
379 | if (r1 & (BRK_ABRT | PAR_ERR | Rx_OVR | CRC_ERR)) { | 368 | if (r1 & (BRK_ABRT | PAR_ERR | Rx_OVR | CRC_ERR)) { |
380 | if (r1 & BRK_ABRT) { | 369 | if (r1 & BRK_ABRT) { |
@@ -391,28 +380,21 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up, | |||
391 | up->port.icount.overrun++; | 380 | up->port.icount.overrun++; |
392 | r1 &= up->port.read_status_mask; | 381 | r1 &= up->port.read_status_mask; |
393 | if (r1 & BRK_ABRT) | 382 | if (r1 & BRK_ABRT) |
394 | *tty->flip.flag_buf_ptr = TTY_BREAK; | 383 | flag = TTY_BREAK; |
395 | else if (r1 & PAR_ERR) | 384 | else if (r1 & PAR_ERR) |
396 | *tty->flip.flag_buf_ptr = TTY_PARITY; | 385 | flag = TTY_PARITY; |
397 | else if (r1 & CRC_ERR) | 386 | else if (r1 & CRC_ERR) |
398 | *tty->flip.flag_buf_ptr = TTY_FRAME; | 387 | flag = TTY_FRAME; |
399 | } | 388 | } |
400 | if (uart_handle_sysrq_char(&up->port, ch, regs)) | 389 | if (uart_handle_sysrq_char(&up->port, ch, regs)) |
401 | continue; | 390 | continue; |
402 | 391 | ||
403 | if (up->port.ignore_status_mask == 0xff || | 392 | if (up->port.ignore_status_mask == 0xff || |
404 | (r1 & up->port.ignore_status_mask) == 0) { | 393 | (r1 & up->port.ignore_status_mask) == 0) { |
405 | tty->flip.flag_buf_ptr++; | 394 | tty_insert_flip_char(tty, ch, flag); |
406 | tty->flip.char_buf_ptr++; | ||
407 | tty->flip.count++; | ||
408 | } | ||
409 | if ((r1 & Rx_OVR) && | ||
410 | tty->flip.count < TTY_FLIPBUF_SIZE) { | ||
411 | *tty->flip.flag_buf_ptr = TTY_OVERRUN; | ||
412 | tty->flip.flag_buf_ptr++; | ||
413 | tty->flip.char_buf_ptr++; | ||
414 | tty->flip.count++; | ||
415 | } | 395 | } |
396 | if (r1 & Rx_OVR) | ||
397 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | ||
416 | } | 398 | } |
417 | 399 | ||
418 | return tty; | 400 | return tty; |