mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
USB: pl2303: remove bogus checks and fix speed support to use tty_get_baud_rate()
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
31473aae5a
commit
e0c79f512c
1 changed files with 1 additions and 32 deletions
|
@ -484,15 +484,6 @@ static void pl2303_set_termios(struct usb_serial_port *port,
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
|
||||||
cflag = port->tty->termios->c_cflag;
|
cflag = port->tty->termios->c_cflag;
|
||||||
/* check that they really want us to change something */
|
|
||||||
if (old_termios) {
|
|
||||||
if ((cflag == old_termios->c_cflag) &&
|
|
||||||
(RELEVANT_IFLAG(port->tty->termios->c_iflag) ==
|
|
||||||
RELEVANT_IFLAG(old_termios->c_iflag))) {
|
|
||||||
dbg("%s - nothing to change...", __FUNCTION__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = kzalloc(7, GFP_KERNEL);
|
buf = kzalloc(7, GFP_KERNEL);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
|
@ -517,29 +508,7 @@ static void pl2303_set_termios(struct usb_serial_port *port,
|
||||||
dbg("%s - data bits = %d", __FUNCTION__, buf[6]);
|
dbg("%s - data bits = %d", __FUNCTION__, buf[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
baud = 0;
|
baud = tty_get_baud_rate(port->tty);;
|
||||||
switch (cflag & CBAUD) {
|
|
||||||
case B0: baud = 0; break;
|
|
||||||
case B75: baud = 75; break;
|
|
||||||
case B150: baud = 150; break;
|
|
||||||
case B300: baud = 300; break;
|
|
||||||
case B600: baud = 600; break;
|
|
||||||
case B1200: baud = 1200; break;
|
|
||||||
case B1800: baud = 1800; break;
|
|
||||||
case B2400: baud = 2400; break;
|
|
||||||
case B4800: baud = 4800; break;
|
|
||||||
case B9600: baud = 9600; break;
|
|
||||||
case B19200: baud = 19200; break;
|
|
||||||
case B38400: baud = 38400; break;
|
|
||||||
case B57600: baud = 57600; break;
|
|
||||||
case B115200: baud = 115200; break;
|
|
||||||
case B230400: baud = 230400; break;
|
|
||||||
case B460800: baud = 460800; break;
|
|
||||||
default:
|
|
||||||
dev_err(&port->dev, "pl2303 driver does not support"
|
|
||||||
" the baudrate requested (fix it)\n");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
dbg("%s - baud = %d", __FUNCTION__, baud);
|
dbg("%s - baud = %d", __FUNCTION__, baud);
|
||||||
if (baud) {
|
if (baud) {
|
||||||
buf[0] = baud & 0xff;
|
buf[0] = baud & 0xff;
|
||||||
|
|
Loading…
Reference in a new issue