diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:03 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:21:36 -0500 |
commit | 92a19f9cec9a80ad93c06e115822deb729e2c6ad (patch) | |
tree | 80e1550ac1647a1cdf20a0b568554c0c50a63f75 /drivers/tty/cyclades.c | |
parent | 2f69335710884ae6112fc8196ebe29b5cda7b79b (diff) |
TTY: switch tty_insert_flip_char
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty in many
call sites. Only tty_port will needed and hence no more
tty_port_tty_get in those paths.
tty_insert_flip_char is the next one to proceed. This one is used all
over the code, so the patch is huge.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/cyclades.c')
-rw-r--r-- | drivers/tty/cyclades.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index 0b7573dbf439..d1fe9a1f8475 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c | |||
@@ -492,34 +492,34 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, | |||
492 | if (tty_buffer_request_room(port, 1)) { | 492 | if (tty_buffer_request_room(port, 1)) { |
493 | if (data & info->read_status_mask) { | 493 | if (data & info->read_status_mask) { |
494 | if (data & CyBREAK) { | 494 | if (data & CyBREAK) { |
495 | tty_insert_flip_char(tty, | 495 | tty_insert_flip_char(port, |
496 | cyy_readb(info, CyRDSR), | 496 | cyy_readb(info, CyRDSR), |
497 | TTY_BREAK); | 497 | TTY_BREAK); |
498 | info->icount.rx++; | 498 | info->icount.rx++; |
499 | if (port->flags & ASYNC_SAK) | 499 | if (port->flags & ASYNC_SAK) |
500 | do_SAK(tty); | 500 | do_SAK(tty); |
501 | } else if (data & CyFRAME) { | 501 | } else if (data & CyFRAME) { |
502 | tty_insert_flip_char(tty, | 502 | tty_insert_flip_char(port, |
503 | cyy_readb(info, CyRDSR), | 503 | cyy_readb(info, CyRDSR), |
504 | TTY_FRAME); | 504 | TTY_FRAME); |
505 | info->icount.rx++; | 505 | info->icount.rx++; |
506 | info->idle_stats.frame_errs++; | 506 | info->idle_stats.frame_errs++; |
507 | } else if (data & CyPARITY) { | 507 | } else if (data & CyPARITY) { |
508 | /* Pieces of seven... */ | 508 | /* Pieces of seven... */ |
509 | tty_insert_flip_char(tty, | 509 | tty_insert_flip_char(port, |
510 | cyy_readb(info, CyRDSR), | 510 | cyy_readb(info, CyRDSR), |
511 | TTY_PARITY); | 511 | TTY_PARITY); |
512 | info->icount.rx++; | 512 | info->icount.rx++; |
513 | info->idle_stats.parity_errs++; | 513 | info->idle_stats.parity_errs++; |
514 | } else if (data & CyOVERRUN) { | 514 | } else if (data & CyOVERRUN) { |
515 | tty_insert_flip_char(tty, 0, | 515 | tty_insert_flip_char(port, 0, |
516 | TTY_OVERRUN); | 516 | TTY_OVERRUN); |
517 | info->icount.rx++; | 517 | info->icount.rx++; |
518 | /* If the flip buffer itself is | 518 | /* If the flip buffer itself is |
519 | overflowing, we still lose | 519 | overflowing, we still lose |
520 | the next incoming character. | 520 | the next incoming character. |
521 | */ | 521 | */ |
522 | tty_insert_flip_char(tty, | 522 | tty_insert_flip_char(port, |
523 | cyy_readb(info, CyRDSR), | 523 | cyy_readb(info, CyRDSR), |
524 | TTY_FRAME); | 524 | TTY_FRAME); |
525 | info->icount.rx++; | 525 | info->icount.rx++; |
@@ -529,12 +529,12 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, | |||
529 | /* } else if(data & CyTIMEOUT) { */ | 529 | /* } else if(data & CyTIMEOUT) { */ |
530 | /* } else if(data & CySPECHAR) { */ | 530 | /* } else if(data & CySPECHAR) { */ |
531 | } else { | 531 | } else { |
532 | tty_insert_flip_char(tty, 0, | 532 | tty_insert_flip_char(port, 0, |
533 | TTY_NORMAL); | 533 | TTY_NORMAL); |
534 | info->icount.rx++; | 534 | info->icount.rx++; |
535 | } | 535 | } |
536 | } else { | 536 | } else { |
537 | tty_insert_flip_char(tty, 0, TTY_NORMAL); | 537 | tty_insert_flip_char(port, 0, TTY_NORMAL); |
538 | info->icount.rx++; | 538 | info->icount.rx++; |
539 | } | 539 | } |
540 | } else { | 540 | } else { |
@@ -557,7 +557,7 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, | |||
557 | len = tty_buffer_request_room(port, char_count); | 557 | len = tty_buffer_request_room(port, char_count); |
558 | while (len--) { | 558 | while (len--) { |
559 | data = cyy_readb(info, CyRDSR); | 559 | data = cyy_readb(info, CyRDSR); |
560 | tty_insert_flip_char(tty, data, TTY_NORMAL); | 560 | tty_insert_flip_char(port, data, TTY_NORMAL); |
561 | info->idle_stats.recv_bytes++; | 561 | info->idle_stats.recv_bytes++; |
562 | info->icount.rx++; | 562 | info->icount.rx++; |
563 | #ifdef CY_16Y_HACK | 563 | #ifdef CY_16Y_HACK |
@@ -992,7 +992,7 @@ static void cyz_handle_rx(struct cyclades_port *info, struct tty_struct *tty) | |||
992 | new_rx_get); | 992 | new_rx_get); |
993 | new_rx_get = (new_rx_get + 1) & | 993 | new_rx_get = (new_rx_get + 1) & |
994 | (rx_bufsize - 1); | 994 | (rx_bufsize - 1); |
995 | tty_insert_flip_char(tty, data, TTY_NORMAL); | 995 | tty_insert_flip_char(port, data, TTY_NORMAL); |
996 | info->idle_stats.recv_bytes++; | 996 | info->idle_stats.recv_bytes++; |
997 | info->icount.rx++; | 997 | info->icount.rx++; |
998 | } | 998 | } |
@@ -1117,17 +1117,17 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo) | |||
1117 | 1117 | ||
1118 | switch (cmd) { | 1118 | switch (cmd) { |
1119 | case C_CM_PR_ERROR: | 1119 | case C_CM_PR_ERROR: |
1120 | tty_insert_flip_char(tty, 0, TTY_PARITY); | 1120 | tty_insert_flip_char(&info->port, 0, TTY_PARITY); |
1121 | info->icount.rx++; | 1121 | info->icount.rx++; |
1122 | special_count++; | 1122 | special_count++; |
1123 | break; | 1123 | break; |
1124 | case C_CM_FR_ERROR: | 1124 | case C_CM_FR_ERROR: |
1125 | tty_insert_flip_char(tty, 0, TTY_FRAME); | 1125 | tty_insert_flip_char(&info->port, 0, TTY_FRAME); |
1126 | info->icount.rx++; | 1126 | info->icount.rx++; |
1127 | special_count++; | 1127 | special_count++; |
1128 | break; | 1128 | break; |
1129 | case C_CM_RXBRK: | 1129 | case C_CM_RXBRK: |
1130 | tty_insert_flip_char(tty, 0, TTY_BREAK); | 1130 | tty_insert_flip_char(&info->port, 0, TTY_BREAK); |
1131 | info->icount.rx++; | 1131 | info->icount.rx++; |
1132 | special_count++; | 1132 | special_count++; |
1133 | break; | 1133 | break; |