aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cyberjack.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/cyberjack.c')
-rw-r--r--drivers/usb/serial/cyberjack.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 69a4fa1cee25..629bd2894506 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -324,7 +324,6 @@ static void cyberjack_read_bulk_callback(struct urb *urb)
324 struct usb_serial_port *port = urb->context; 324 struct usb_serial_port *port = urb->context;
325 struct cyberjack_private *priv = usb_get_serial_port_data(port); 325 struct cyberjack_private *priv = usb_get_serial_port_data(port);
326 struct device *dev = &port->dev; 326 struct device *dev = &port->dev;
327 struct tty_struct *tty;
328 unsigned char *data = urb->transfer_buffer; 327 unsigned char *data = urb->transfer_buffer;
329 short todo; 328 short todo;
330 int result; 329 int result;
@@ -337,16 +336,10 @@ static void cyberjack_read_bulk_callback(struct urb *urb)
337 return; 336 return;
338 } 337 }
339 338
340 tty = tty_port_tty_get(&port->port);
341 if (!tty) {
342 dev_dbg(dev, "%s - ignoring since device not open\n", __func__);
343 return;
344 }
345 if (urb->actual_length) { 339 if (urb->actual_length) {
346 tty_insert_flip_string(tty, data, urb->actual_length); 340 tty_insert_flip_string(&port->port, data, urb->actual_length);
347 tty_flip_buffer_push(tty); 341 tty_flip_buffer_push(&port->port);
348 } 342 }
349 tty_kref_put(tty);
350 343
351 spin_lock(&priv->lock); 344 spin_lock(&priv->lock);
352 345