Commit 7fa36a99 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

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: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 73f59308
...@@ -973,6 +973,8 @@ static void digi_set_termios(struct usb_serial_port *port, ...@@ -973,6 +973,8 @@ static void digi_set_termios(struct usb_serial_port *port,
} }
} }
/* set parity */ /* set parity */
tty->termios->c_cflag &= ~CMSPAR;
if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) { if ((cflag&(PARENB|PARODD)) != (old_cflag&(PARENB|PARODD))) {
if (cflag&PARENB) { if (cflag&PARENB) {
if (cflag&PARODD) if (cflag&PARODD)
...@@ -1054,15 +1056,15 @@ static void digi_set_termios(struct usb_serial_port *port, ...@@ -1054,15 +1056,15 @@ static void digi_set_termios(struct usb_serial_port *port,
} }
/* set output flow control */ /* set output flow control */
if ((iflag&IXON) != (old_iflag&IXON) if ((iflag & IXON) != (old_iflag & IXON)
|| (cflag&CRTSCTS) != (old_cflag&CRTSCTS)) { || (cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
arg = 0; arg = 0;
if (iflag&IXON) if (iflag & IXON)
arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; arg |= DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
else else
arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF; arg &= ~DIGI_OUTPUT_FLOW_CONTROL_XON_XOFF;
if (cflag&CRTSCTS) { if (cflag & CRTSCTS) {
arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS; arg |= DIGI_OUTPUT_FLOW_CONTROL_CTS;
} else { } else {
arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS; arg &= ~DIGI_OUTPUT_FLOW_CONTROL_CTS;
...@@ -1076,8 +1078,8 @@ static void digi_set_termios(struct usb_serial_port *port, ...@@ -1076,8 +1078,8 @@ static void digi_set_termios(struct usb_serial_port *port,
} }
/* set receive enable/disable */ /* set receive enable/disable */
if ((cflag&CREAD) != (old_cflag&CREAD)) { if ((cflag & CREAD) != (old_cflag & CREAD)) {
if (cflag&CREAD) if (cflag & CREAD)
arg = DIGI_ENABLE; arg = DIGI_ENABLE;
else else
arg = DIGI_DISABLE; arg = DIGI_DISABLE;
...@@ -1089,7 +1091,7 @@ static void digi_set_termios(struct usb_serial_port *port, ...@@ -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) if ((ret = digi_write_oob_command(port, buf, i, 1)) != 0)
dbg("digi_set_termios: write oob failed, ret=%d", ret); dbg("digi_set_termios: write oob failed, ret=%d", ret);
tty_encode_baud_rate(tty, baud, baud);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment