From c7bce3097c0f9bbed76ee6fd03742f2624031a45 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 30 Sep 2006 23:27:24 -0700 Subject: [PATCH] serial: Fix up offenders peering at baud bits directly Stop some other people peering into the baud bits on their own and make them use the tty_get_baud_rate() helper as a preperation for the move to the new termios. Corrected dependancy previous one had on new termios structs Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/riscom8.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'drivers/char/riscom8.c') diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index f1c94f771af..06b9f78a95d 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) port->COR2 = 0; port->MSVR = MSVR_RTS; - baud = C_BAUD(tty); - - if (baud & CBAUDEX) { - baud &= ~CBAUDEX; - if (baud < 1 || baud > 2) - port->tty->termios->c_cflag &= ~CBAUDEX; - else - baud += 15; - } - if (baud == 15) { - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) - baud ++; - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) - baud += 2; - } + baud = tty_get_baud_rate(tty); /* Select port on the board */ rc_out(bp, CD180_CAR, port_No(port)); - if (!baud_table[baud]) { + if (!baud) { /* Drop DTR & exit */ bp->DTR |= (1u << port_No(port)); rc_out(bp, RC_DTR, bp->DTR); @@ -710,7 +696,7 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) */ /* Set baud rate for port */ - tmp = (((RC_OSCFREQ + baud_table[baud]/2) / baud_table[baud] + + tmp = (((RC_OSCFREQ + baud/2) / baud + CD180_TPC/2) / CD180_TPC); 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) rc_out(bp, CD180_RBPRL, tmp & 0xff); rc_out(bp, CD180_TBPRL, tmp & 0xff); - baud = (baud_table[baud] + 5) / 10; /* Estimated CPS */ + baud = (baud + 5) / 10; /* Estimated CPS */ /* Two timer ticks seems enough to wakeup something like SLIP driver */ tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO; -- cgit v1.2.3