diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-10-18 01:24:25 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-25 12:18:43 -0700 |
commit | 6ce073bd8be0a741440944fed892a136a1d24bbe (patch) | |
tree | ff1bf5c19fd6a70016b2e4570513dac545c83443 /drivers/usb/serial | |
parent | bd5e47ccb656e74a775c002d0308c666bea65a2b (diff) |
USB: io_edgeport: cleanups, and tty speed reporting
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>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 8dd3abc99d6..a5d2e115e16 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -1503,22 +1503,16 @@ static void edge_unthrottle (struct usb_serial_port *port) *****************************************************************************/ static void edge_set_termios (struct usb_serial_port *port, struct ktermios *old_termios) { + /* FIXME: This function appears unused ?? */ struct edgeport_port *edge_port = usb_get_serial_port_data(port); struct tty_struct *tty = port->tty; unsigned int cflag; - if (!port->tty || !port->tty->termios) { - dbg ("%s - no tty or termios", __FUNCTION__); - return; - } - cflag = tty->termios->c_cflag; dbg("%s - clfag %08x iflag %08x", __FUNCTION__, tty->termios->c_cflag, tty->termios->c_iflag); - if (old_termios) { - dbg("%s - old clfag %08x old iflag %08x", __FUNCTION__, - old_termios->c_cflag, old_termios->c_iflag); - } + dbg("%s - old clfag %08x old iflag %08x", __FUNCTION__, + old_termios->c_cflag, old_termios->c_iflag); dbg("%s - port %d", __FUNCTION__, port->number); @@ -2653,7 +2647,11 @@ static void change_port_settings (struct edgeport_port *edge_port, struct ktermi dbg("%s - baud rate = %d", __FUNCTION__, baud); status = send_cmd_write_baud_rate (edge_port, baud); - + if (status == -1) { + /* Speed change was not possible - put back the old speed */ + baud = tty_termios_baud_rate(old_termios); + tty_encode_baud_rate(tty, baud, baud); + } return; } |