Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303597
b: refs/heads/master
c: 81d5a67
h: refs/heads/master
i:
  303595: 2832aed
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Apr 25, 2012
1 parent 147e30d commit 824f68b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33f7a67e477f780b82ef36ce358f6d5290d6a9b2
refs/heads/master: 81d5a6729018ef18dcc1a555144ce91eb3c9abc4
15 changes: 10 additions & 5 deletions trunk/drivers/usb/serial/opticon.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ static int opticon_tiocmget(struct tty_struct *tty)
int result = 0;

dbg("%s - port %d", __func__, port->number);
if (!usb_get_intfdata(port->serial->interface))
return -ENODEV;

spin_lock_irqsave(&priv->lock, flags);
if (priv->rts)
Expand All @@ -419,13 +417,13 @@ static int opticon_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
struct usb_serial_port *port = tty->driver_data;
struct usb_serial *serial = port->serial;
struct opticon_private *priv = usb_get_serial_data(port->serial);
unsigned long flags;
bool rts;
bool changed = false;
int ret;

if (!usb_get_intfdata(port->serial->interface))
return -ENODEV;
/* We only support RTS so we only handle that */
spin_lock_irqsave(&priv->lock, flags);

Expand All @@ -441,7 +439,14 @@ static int opticon_tiocmset(struct tty_struct *tty,
return 0;

/* Send the new RTS state to the connected device */
return send_control_msg(port, CONTROL_RTS, !rts);
mutex_lock(&serial->disc_mutex);
if (!serial->disconnected)
ret = send_control_msg(port, CONTROL_RTS, !rts);
else
ret = -ENODEV;
mutex_unlock(&serial->disc_mutex);

return ret;
}

static int get_serial_info(struct opticon_private *priv,
Expand Down

0 comments on commit 824f68b

Please sign in to comment.