diff options
-rw-r--r-- | drivers/usb/serial/opticon.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index 6af5bb810062..5f4b0cd0f6e9 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c | |||
@@ -309,7 +309,6 @@ static int opticon_tiocmset(struct tty_struct *tty, | |||
309 | unsigned int set, unsigned int clear) | 309 | unsigned int set, unsigned int clear) |
310 | { | 310 | { |
311 | struct usb_serial_port *port = tty->driver_data; | 311 | struct usb_serial_port *port = tty->driver_data; |
312 | struct usb_serial *serial = port->serial; | ||
313 | struct opticon_private *priv = usb_get_serial_port_data(port); | 312 | struct opticon_private *priv = usb_get_serial_port_data(port); |
314 | unsigned long flags; | 313 | unsigned long flags; |
315 | bool rts; | 314 | bool rts; |
@@ -330,18 +329,11 @@ static int opticon_tiocmset(struct tty_struct *tty, | |||
330 | if (!changed) | 329 | if (!changed) |
331 | return 0; | 330 | return 0; |
332 | 331 | ||
333 | /* Send the new RTS state to the connected device */ | 332 | ret = send_control_msg(port, CONTROL_RTS, !rts); |
334 | mutex_lock(&serial->disc_mutex); | 333 | if (ret) |
335 | if (!serial->disconnected) { | 334 | return usb_translate_errors(ret); |
336 | ret = send_control_msg(port, CONTROL_RTS, !rts); | ||
337 | if (ret) | ||
338 | ret = usb_translate_errors(ret); | ||
339 | } else { | ||
340 | ret = -ENODEV; | ||
341 | } | ||
342 | mutex_unlock(&serial->disc_mutex); | ||
343 | 335 | ||
344 | return ret; | 336 | return 0; |
345 | } | 337 | } |
346 | 338 | ||
347 | static int get_serial_info(struct usb_serial_port *port, | 339 | static int get_serial_info(struct usb_serial_port *port, |