Commit 2dec3582 authored by Johan Hovold's avatar Johan Hovold Committed by Ben Hutchings

USB: serial: opticon: fix CTS retrieval at open

commit 2eee0502 upstream.

The opticon driver used a control request at open to trigger a CTS
status notification to be sent over the bulk-in pipe. When the driver
was converted to using the generic read implementation, an inverted test
prevented this request from being sent, something which could lead to
TIOCMGET reporting an incorrect CTS state.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Fixes: 7a6ee2b0 ("USB: opticon: switch to generic read
implementation")
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 9d4e68f7
...@@ -142,7 +142,7 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -142,7 +142,7 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port)
usb_clear_halt(port->serial->dev, port->read_urb->pipe); usb_clear_halt(port->serial->dev, port->read_urb->pipe);
res = usb_serial_generic_open(tty, port); res = usb_serial_generic_open(tty, port);
if (!res) if (res)
return res; return res;
/* Request CTS line state, sometimes during opening the current /* Request CTS line state, sometimes during opening the current
......
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