diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2007-10-18 04:24:19 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-25 15:18:41 -0400 |
commit | 7fa36a994cb4298f29994a248ced831be8dc7051 (patch) | |
tree | 65a31bd6116536761e6c7b462d37928280e3a622 /drivers | |
parent | 73f593081911b1be0d8d3962ecedd635c1e27179 (diff) |
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')
-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, | |||
973 | } | 973 | } |
974 | } | 974 | } |
975 | /* set parity */ | 975 | /* set parity */ |
976 | tty->termios->c_cflag &= ~CMSPAR; | ||
977 | |||
976 | if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) { | 978 | if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) { |
977 | if (cflag&PARENB) { | 979 | if (cflag&PARENB) { |
978 | if (cflag&PARODD) | 980 | if (cflag&PARODD) |
@@ -1054,15 +1056,15 @@ static void digi_set_termios(struct usb_serial_port *port, | |||
1054 | } | 1056 | } |
1055 | 1057 | ||
1056 | /* set output flow control */ | 1058 | /* set output flow control */ |
1057 | if ((iflag&IXON) != (old_iflag&IXON) | 1059 | if ((iflag & IXON) != (old_iflag & IXON) |
1058 | || (cflag&CRTSCTS) != (old_cflag&CRTSCTS)) { | 1060 | || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) { |
1059 | arg = 0; | 1061 | arg = 0; |
1060 | if (iflag&IXON) | 1062 | if (iflag & IXON) |
1061 | arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; | 1063 | arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; |
1062 | else | 1064 | else |
1063 | arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; | 1065 | arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; |
1064 | 1066 | ||
1065 | if (cflag&CRTSCTS) { | 1067 | if (cflag & CRTSCTS) { |
1066 | arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS; | 1068 | arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS; |
1067 | } else { | 1069 | } else { |
1068 | arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS; | 1070 | arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS; |
@@ -1076,8 +1078,8 @@ static void digi_set_termios(struct usb_serial_port *port, | |||
1076 | } | 1078 | } |
1077 | 1079 | ||
1078 | /* set receive enable/disable */ | 1080 | /* set receive enable/disable */ |
1079 | if ((cflag&CREAD) != (old_cflag&CREAD)) { | 1081 | if ((cflag & CREAD) != (old_cflag & CREAD)) { |
1080 | if (cflag&CREAD) | 1082 | if (cflag & CREAD) |
1081 | arg = DIGI_ENABLE; | 1083 | arg = DIGI_ENABLE; |
1082 | else | 1084 | else |
1083 | arg = DIGI_DISABLE; | 1085 | arg = DIGI_DISABLE; |
@@ -1089,7 +1091,7 @@ static void digi_set_termios(struct usb_serial_port *port, | |||
1089 | } | 1091 | } |
1090 | if ((ret = digi_write_oob_command(port, buf, i, 1)) != 0) | 1092 | if ((ret = digi_write_oob_command(port, buf, i, 1)) != 0) |
1091 | dbg("digi_set_termios: write oob failed, ret=%d", ret); | 1093 | dbg("digi_set_termios: write oob failed, ret=%d", ret); |
1092 | 1094 | tty_encode_baud_rate(tty, baud, baud); | |
1093 | } | 1095 | } |
1094 | 1096 | ||
1095 | 1097 | ||