aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_edgeport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/io_edgeport.c')
-rw-r--r--drivers/usb/serial/io_edgeport.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 44e5208f7c61..cf0b0a2f7b56 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -110,7 +110,6 @@ struct edgeport_port {
110 wait_queue_head_t wait_chase; /* for handling sleeping while waiting for chase to finish */ 110 wait_queue_head_t wait_chase; /* for handling sleeping while waiting for chase to finish */
111 wait_queue_head_t wait_open; /* for handling sleeping while waiting for open to finish */ 111 wait_queue_head_t wait_open; /* for handling sleeping while waiting for open to finish */
112 wait_queue_head_t wait_command; /* for handling sleeping while waiting for command to finish */ 112 wait_queue_head_t wait_command; /* for handling sleeping while waiting for command to finish */
113 wait_queue_head_t delta_msr_wait; /* for handling sleeping while waiting for msr change to happen */
114 113
115 struct async_icount icount; 114 struct async_icount icount;
116 struct usb_serial_port *port; /* loop back to the owner of this object */ 115 struct usb_serial_port *port; /* loop back to the owner of this object */
@@ -866,7 +865,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
866 /* initialize our wait queues */ 865 /* initialize our wait queues */
867 init_waitqueue_head(&edge_port->wait_open); 866 init_waitqueue_head(&edge_port->wait_open);
868 init_waitqueue_head(&edge_port->wait_chase); 867 init_waitqueue_head(&edge_port->wait_chase);
869 init_waitqueue_head(&edge_port->delta_msr_wait);
870 init_waitqueue_head(&edge_port->wait_command); 868 init_waitqueue_head(&edge_port->wait_command);
871 869
872 /* initialize our icount structure */ 870 /* initialize our icount structure */
@@ -1651,13 +1649,17 @@ static int edge_ioctl(struct tty_struct *tty,
1651 dev_dbg(&port->dev, "%s (%d) TIOCMIWAIT\n", __func__, port->number); 1649 dev_dbg(&port->dev, "%s (%d) TIOCMIWAIT\n", __func__, port->number);
1652 cprev = edge_port->icount; 1650 cprev = edge_port->icount;
1653 while (1) { 1651 while (1) {
1654 prepare_to_wait(&edge_port->delta_msr_wait, 1652 prepare_to_wait(&port->delta_msr_wait,
1655 &wait, TASK_INTERRUPTIBLE); 1653 &wait, TASK_INTERRUPTIBLE);
1656 schedule(); 1654 schedule();
1657 finish_wait(&edge_port->delta_msr_wait, &wait); 1655 finish_wait(&port->delta_msr_wait, &wait);
1658 /* see if a signal did it */ 1656 /* see if a signal did it */
1659 if (signal_pending(current)) 1657 if (signal_pending(current))
1660 return -ERESTARTSYS; 1658 return -ERESTARTSYS;
1659
1660 if (port->serial->disconnected)
1661 return -EIO;
1662
1661 cnow = edge_port->icount; 1663 cnow = edge_port->icount;
1662 if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && 1664 if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
1663 cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) 1665 cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
@@ -2033,7 +2035,7 @@ static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr)
2033 icount->dcd++; 2035 icount->dcd++;
2034 if (newMsr & EDGEPORT_MSR_DELTA_RI) 2036 if (newMsr & EDGEPORT_MSR_DELTA_RI)
2035 icount->rng++; 2037 icount->rng++;
2036 wake_up_interruptible(&edge_port->delta_msr_wait); 2038 wake_up_interruptible(&edge_port->port->delta_msr_wait);
2037 } 2039 }
2038 2040
2039 /* Save the new modem status */ 2041 /* Save the new modem status */