aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_ti.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/io_ti.c')
-rw-r--r--drivers/usb/serial/io_ti.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 82afc4d6a327..b5ab0a54b6b6 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -201,8 +201,8 @@ static int closing_wait = EDGE_CLOSING_WAIT;
201static bool ignore_cpu_rev; 201static bool ignore_cpu_rev;
202static int default_uart_mode; /* RS232 */ 202static int default_uart_mode; /* RS232 */
203 203
204static void edge_tty_recv(struct device *dev, struct tty_struct *tty, 204static void edge_tty_recv(struct usb_serial_port *port, unsigned char *data,
205 unsigned char *data, int length); 205 int length);
206 206
207static void stop_read(struct edgeport_port *edge_port); 207static void stop_read(struct edgeport_port *edge_port);
208static int restart_read(struct edgeport_port *edge_port); 208static int restart_read(struct edgeport_port *edge_port);
@@ -1543,7 +1543,6 @@ static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data,
1543 struct async_icount *icount; 1543 struct async_icount *icount;
1544 __u8 new_lsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR | 1544 __u8 new_lsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR |
1545 LSR_FRM_ERR | LSR_BREAK)); 1545 LSR_FRM_ERR | LSR_BREAK));
1546 struct tty_struct *tty;
1547 1546
1548 dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, new_lsr); 1547 dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, new_lsr);
1549 1548
@@ -1557,13 +1556,8 @@ static void handle_new_lsr(struct edgeport_port *edge_port, int lsr_data,
1557 new_lsr &= (__u8)(LSR_OVER_ERR | LSR_BREAK); 1556 new_lsr &= (__u8)(LSR_OVER_ERR | LSR_BREAK);
1558 1557
1559 /* Place LSR data byte into Rx buffer */ 1558 /* Place LSR data byte into Rx buffer */
1560 if (lsr_data) { 1559 if (lsr_data)
1561 tty = tty_port_tty_get(&edge_port->port->port); 1560 edge_tty_recv(edge_port->port, &data, 1);
1562 if (tty) {
1563 edge_tty_recv(&edge_port->port->dev, tty, &data, 1);
1564 tty_kref_put(tty);
1565 }
1566 }
1567 1561
1568 /* update input line counters */ 1562 /* update input line counters */
1569 icount = &edge_port->icount; 1563 icount = &edge_port->icount;
@@ -1679,7 +1673,6 @@ static void edge_bulk_in_callback(struct urb *urb)
1679 struct edgeport_port *edge_port = urb->context; 1673 struct edgeport_port *edge_port = urb->context;
1680 struct device *dev = &edge_port->port->dev; 1674 struct device *dev = &edge_port->port->dev;
1681 unsigned char *data = urb->transfer_buffer; 1675 unsigned char *data = urb->transfer_buffer;
1682 struct tty_struct *tty;
1683 int retval = 0; 1676 int retval = 0;
1684 int port_number; 1677 int port_number;
1685 int status = urb->status; 1678 int status = urb->status;
@@ -1718,17 +1711,16 @@ static void edge_bulk_in_callback(struct urb *urb)
1718 ++data; 1711 ++data;
1719 } 1712 }
1720 1713
1721 tty = tty_port_tty_get(&edge_port->port->port); 1714 if (urb->actual_length) {
1722 if (tty && urb->actual_length) {
1723 usb_serial_debug_data(dev, __func__, urb->actual_length, data); 1715 usb_serial_debug_data(dev, __func__, urb->actual_length, data);
1724 if (edge_port->close_pending) 1716 if (edge_port->close_pending)
1725 dev_dbg(dev, "%s - close pending, dropping data on the floor\n", 1717 dev_dbg(dev, "%s - close pending, dropping data on the floor\n",
1726 __func__); 1718 __func__);
1727 else 1719 else
1728 edge_tty_recv(dev, tty, data, urb->actual_length); 1720 edge_tty_recv(edge_port->port, data,
1721 urb->actual_length);
1729 edge_port->icount.rx += urb->actual_length; 1722 edge_port->icount.rx += urb->actual_length;
1730 } 1723 }
1731 tty_kref_put(tty);
1732 1724
1733exit: 1725exit:
1734 /* continue read unless stopped */ 1726 /* continue read unless stopped */
@@ -1743,16 +1735,16 @@ exit:
1743 dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval); 1735 dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval);
1744} 1736}
1745 1737
1746static void edge_tty_recv(struct device *dev, struct tty_struct *tty, 1738static void edge_tty_recv(struct usb_serial_port *port, unsigned char *data,
1747 unsigned char *data, int length) 1739 int length)
1748{ 1740{
1749 int queued; 1741 int queued;
1750 1742
1751 queued = tty_insert_flip_string(tty, data, length); 1743 queued = tty_insert_flip_string(&port->port, data, length);
1752 if (queued < length) 1744 if (queued < length)
1753 dev_err(dev, "%s - dropping data, %d bytes lost\n", 1745 dev_err(&port->dev, "%s - dropping data, %d bytes lost\n",
1754 __func__, length - queued); 1746 __func__, length - queued);
1755 tty_flip_buffer_push(tty); 1747 tty_flip_buffer_push(&port->port);
1756} 1748}
1757 1749
1758static void edge_bulk_out_callback(struct urb *urb) 1750static void edge_bulk_out_callback(struct urb *urb)