diff options
Diffstat (limited to 'drivers/char/riscom8.c')
-rw-r--r-- | drivers/char/riscom8.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index f1c94f771af5..214d850112fd 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c | |||
@@ -675,26 +675,12 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) | |||
675 | port->COR2 = 0; | 675 | port->COR2 = 0; |
676 | port->MSVR = MSVR_RTS; | 676 | port->MSVR = MSVR_RTS; |
677 | 677 | ||
678 | baud = C_BAUD(tty); | 678 | baud = tty_get_baud_rate(tty); |
679 | |||
680 | if (baud & CBAUDEX) { | ||
681 | baud &= ~CBAUDEX; | ||
682 | if (baud < 1 || baud > 2) | ||
683 | port->tty->termios->c_cflag &= ~CBAUDEX; | ||
684 | else | ||
685 | baud += 15; | ||
686 | } | ||
687 | if (baud == 15) { | ||
688 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | ||
689 | baud ++; | ||
690 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) | ||
691 | baud += 2; | ||
692 | } | ||
693 | 679 | ||
694 | /* Select port on the board */ | 680 | /* Select port on the board */ |
695 | rc_out(bp, CD180_CAR, port_No(port)); | 681 | rc_out(bp, CD180_CAR, port_No(port)); |
696 | 682 | ||
697 | if (!baud_table[baud]) { | 683 | if (!baud) { |
698 | /* Drop DTR & exit */ | 684 | /* Drop DTR & exit */ |
699 | bp->DTR |= (1u << port_No(port)); | 685 | bp->DTR |= (1u << port_No(port)); |
700 | rc_out(bp, RC_DTR, bp->DTR); | 686 | rc_out(bp, RC_DTR, bp->DTR); |
@@ -710,7 +696,7 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) | |||
710 | */ | 696 | */ |
711 | 697 | ||
712 | /* Set baud rate for port */ | 698 | /* Set baud rate for port */ |
713 | tmp = (((RC_OSCFREQ + baud_table[baud]/2) / baud_table[baud] + | 699 | tmp = (((RC_OSCFREQ + baud/2) / baud + |
714 | CD180_TPC/2) / CD180_TPC); | 700 | CD180_TPC/2) / CD180_TPC); |
715 | 701 | ||
716 | rc_out(bp, CD180_RBPRH, (tmp >> 8) & 0xff); | 702 | rc_out(bp, CD180_RBPRH, (tmp >> 8) & 0xff); |
@@ -718,7 +704,7 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) | |||
718 | rc_out(bp, CD180_RBPRL, tmp & 0xff); | 704 | rc_out(bp, CD180_RBPRL, tmp & 0xff); |
719 | rc_out(bp, CD180_TBPRL, tmp & 0xff); | 705 | rc_out(bp, CD180_TBPRL, tmp & 0xff); |
720 | 706 | ||
721 | baud = (baud_table[baud] + 5) / 10; /* Estimated CPS */ | 707 | baud = (baud + 5) / 10; /* Estimated CPS */ |
722 | 708 | ||
723 | /* Two timer ticks seems enough to wakeup something like SLIP driver */ | 709 | /* Two timer ticks seems enough to wakeup something like SLIP driver */ |
724 | tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO; | 710 | tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO; |
@@ -1597,7 +1583,7 @@ static void do_softint(void *private_) | |||
1597 | } | 1583 | } |
1598 | } | 1584 | } |
1599 | 1585 | ||
1600 | static struct tty_operations riscom_ops = { | 1586 | static const struct tty_operations riscom_ops = { |
1601 | .open = rc_open, | 1587 | .open = rc_open, |
1602 | .close = rc_close, | 1588 | .close = rc_close, |
1603 | .write = rc_write, | 1589 | .write = rc_write, |