diff options
Diffstat (limited to 'drivers/usb/serial/ir-usb.c')
-rw-r--r-- | drivers/usb/serial/ir-usb.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index e24e2d4f4c1b..716930ab1bb1 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -287,7 +287,6 @@ static void ir_process_read_urb(struct urb *urb) | |||
287 | { | 287 | { |
288 | struct usb_serial_port *port = urb->context; | 288 | struct usb_serial_port *port = urb->context; |
289 | unsigned char *data = urb->transfer_buffer; | 289 | unsigned char *data = urb->transfer_buffer; |
290 | struct tty_struct *tty; | ||
291 | 290 | ||
292 | if (!urb->actual_length) | 291 | if (!urb->actual_length) |
293 | return; | 292 | return; |
@@ -302,12 +301,8 @@ static void ir_process_read_urb(struct urb *urb) | |||
302 | if (urb->actual_length == 1) | 301 | if (urb->actual_length == 1) |
303 | return; | 302 | return; |
304 | 303 | ||
305 | tty = tty_port_tty_get(&port->port); | 304 | tty_insert_flip_string(&port->port, data + 1, urb->actual_length - 1); |
306 | if (!tty) | 305 | tty_flip_buffer_push(&port->port); |
307 | return; | ||
308 | tty_insert_flip_string(tty, data + 1, urb->actual_length - 1); | ||
309 | tty_flip_buffer_push(tty); | ||
310 | tty_kref_put(tty); | ||
311 | } | 306 | } |
312 | 307 | ||
313 | static void ir_set_termios_callback(struct urb *urb) | 308 | static void ir_set_termios_callback(struct urb *urb) |