diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-10-18 12:24:19 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-25 23:18:41 +0400 |
commit | 7fa36a994cb4298f29994a248ced831be8dc7051 (patch) | |
tree | 65a31bd6116536761e6c7b462d37928280e3a622 /drivers/usb | |
parent | 73f593081911b1be0d8d3962ecedd635c1e27179 (diff) | |
download | linux-7fa36a994cb4298f29994a248ced831be8dc7051.tar.xz |
USB: digi_acceleport: fix termios and also readability a bit
- Expand some x&y to x & y so I could read it when checking
- Clear CMSPAR bit in the termios (as the driver does not support it)
- Encode the speed using the new tty_encode_baud_rate facility
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')
-rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index dab2e66d111d..ae410c4678ea 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -973,6 +973,8 @@ static void digi_set_termios(struct usb_serial_port *port, } } /* set parity */ + tty->termios->c_cflag &= ~CMSPAR; + if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) { if (cflag&PARENB) { if (cflag&PARODD) @@ -1054,15 +1056,15 @@ static void digi_set_termios(struct usb_serial_port *port, } /* set output flow control */ - if ((iflag&IXON) != (old_iflag&IXON) - || (cflag&CRTSCTS) != (old_cflag&CRTSCTS)) { + if ((iflag & IXON) != (old_iflag & IXON) + || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) { arg = 0; - if (iflag&IXON) + if (iflag & IXON) arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; else arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; - if (cflag&CRTSCTS) { + if (cflag & CRTSCTS) { arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS; } else { arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS; @@ -1076,8 +1078,8 @@ static void digi_set_termios(struct usb_serial_port *port, } /* set receive enable/disable */ - if ((cflag&CREAD) != (old_cflag&CREAD)) { - if (cflag&CREAD) + if ((cflag & CREAD) != (old_cflag & CREAD)) { + if (cflag & CREAD) arg = DIGI_ENABLE; else arg = DIGI_DISABLE; @@ -1089,7 +1091,7 @@ static void digi_set_termios(struct usb_serial_port *port, } if ((ret = digi_write_oob_command(port, buf, i, 1)) != 0) dbg("digi_set_termios: write oob failed, ret=%d", ret); - + tty_encode_baud_rate(tty, baud, baud); } |