Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303599
b: refs/heads/master
c: 6f1efd6
h: refs/heads/master
i:
  303597: 824f68b
  303595: 2832aed
  303591: 780a384
  303583: da5dd18
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Apr 25, 2012
1 parent a944e17 commit abc2c73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 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: 1c5176692457c3f249559d29a69affad7447b326
refs/heads/master: 6f1efd6c5aa63ddcfe1ffc60ade716f5421766f4
17 changes: 10 additions & 7 deletions trunk/drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,11 @@ static int pl2303_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 pl2303_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
u8 control;

if (!usb_get_intfdata(port->serial->interface))
return -ENODEV;
int ret;

spin_lock_irqsave(&priv->lock, flags);
if (set & TIOCM_RTS)
Expand All @@ -542,7 +541,14 @@ static int pl2303_tiocmset(struct tty_struct *tty,
control = priv->line_control;
spin_unlock_irqrestore(&priv->lock, flags);

return set_control_lines(port->serial->dev, control);
mutex_lock(&serial->disc_mutex);
if (!serial->disconnected)
ret = set_control_lines(serial->dev, control);
else
ret = -ENODEV;
mutex_unlock(&serial->disc_mutex);

return ret;
}

static int pl2303_tiocmget(struct tty_struct *tty)
Expand All @@ -556,9 +562,6 @@ static int pl2303_tiocmget(struct tty_struct *tty)

dbg("%s (%d)", __func__, port->number);

if (!usb_get_intfdata(port->serial->interface))
return -ENODEV;

spin_lock_irqsave(&priv->lock, flags);
mcr = priv->line_control;
status = priv->line_status;
Expand Down

0 comments on commit abc2c73

Please sign in to comment.