diff options
Diffstat (limited to 'drivers/usb/serial/mos7720.c')
-rw-r--r-- | drivers/usb/serial/mos7720.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index f57a6b1fe787..e0ebec3b5d6a 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -899,7 +899,6 @@ static void mos7720_bulk_in_callback(struct urb *urb) | |||
899 | int retval; | 899 | int retval; |
900 | unsigned char *data ; | 900 | unsigned char *data ; |
901 | struct usb_serial_port *port; | 901 | struct usb_serial_port *port; |
902 | struct tty_struct *tty; | ||
903 | int status = urb->status; | 902 | int status = urb->status; |
904 | 903 | ||
905 | if (status) { | 904 | if (status) { |
@@ -913,12 +912,10 @@ static void mos7720_bulk_in_callback(struct urb *urb) | |||
913 | 912 | ||
914 | data = urb->transfer_buffer; | 913 | data = urb->transfer_buffer; |
915 | 914 | ||
916 | tty = tty_port_tty_get(&port->port); | 915 | if (urb->actual_length) { |
917 | if (tty && urb->actual_length) { | 916 | tty_insert_flip_string(&port->port, data, urb->actual_length); |
918 | tty_insert_flip_string(tty, data, urb->actual_length); | 917 | tty_flip_buffer_push(&port->port); |
919 | tty_flip_buffer_push(tty); | ||
920 | } | 918 | } |
921 | tty_kref_put(tty); | ||
922 | 919 | ||
923 | if (port->read_urb->status != -EINPROGRESS) { | 920 | if (port->read_urb->status != -EINPROGRESS) { |
924 | retval = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 921 | retval = usb_submit_urb(port->read_urb, GFP_ATOMIC); |