Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361648
b: refs/heads/master
c: 356050d
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 21, 2013
1 parent a74624c commit 3518e35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: fa1e11d5231c001c80a479160b5832933c5d35fb
refs/heads/master: 356050d8b1e526db093e9d2c78daf49d6bf418e3
14 changes: 8 additions & 6 deletions trunk/drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ struct cypress_private {
int baud_rate; /* stores current baud rate in
integer form */
int isthrottled; /* if throttled, discard reads */
wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */
char prev_status, diff_status; /* used for TIOCMIWAIT */
/* we pass a pointer to this as the argument sent to
cypress_set_termios old_termios */
Expand Down Expand Up @@ -449,7 +448,6 @@ static int cypress_generic_port_probe(struct usb_serial_port *port)
kfree(priv);
return -ENOMEM;
}
init_waitqueue_head(&priv->delta_msr_wait);

usb_reset_configuration(serial->dev);

Expand Down Expand Up @@ -868,12 +866,16 @@ static int cypress_ioctl(struct tty_struct *tty,
switch (cmd) {
/* This code comes from drivers/char/serial.c and ftdi_sio.c */
case TIOCMIWAIT:
while (priv != NULL) {
interruptible_sleep_on(&priv->delta_msr_wait);
for (;;) {
interruptible_sleep_on(&port->delta_msr_wait);
/* see if a signal did it */
if (signal_pending(current))
return -ERESTARTSYS;
else {

if (port->serial->disconnected)
return -EIO;

{
char diff = priv->diff_status;
if (diff == 0)
return -EIO; /* no change => error */
Expand Down Expand Up @@ -1187,7 +1189,7 @@ static void cypress_read_int_callback(struct urb *urb)
if (priv->current_status != priv->prev_status) {
priv->diff_status |= priv->current_status ^
priv->prev_status;
wake_up_interruptible(&priv->delta_msr_wait);
wake_up_interruptible(&port->delta_msr_wait);
priv->prev_status = priv->current_status;
}
spin_unlock_irqrestore(&priv->lock, flags);
Expand Down

0 comments on commit 3518e35

Please sign in to comment.