aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/symbolserial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/symbolserial.c')
-rw-r--r--drivers/usb/serial/symbolserial.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c
index b282c0f2d8e5..d9457bd4fe10 100644
--- a/drivers/usb/serial/symbolserial.c
+++ b/drivers/usb/serial/symbolserial.c
@@ -12,6 +12,7 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/tty.h> 14#include <linux/tty.h>
15#include <linux/slab.h>
15#include <linux/tty_driver.h> 16#include <linux/tty_driver.h>
16#include <linux/tty_flip.h> 17#include <linux/tty_flip.h>
17#include <linux/module.h> 18#include <linux/module.h>
@@ -21,7 +22,7 @@
21 22
22static int debug; 23static int debug;
23 24
24static struct usb_device_id id_table[] = { 25static const struct usb_device_id id_table[] = {
25 { USB_DEVICE(0x05e0, 0x0600) }, 26 { USB_DEVICE(0x05e0, 0x0600) },
26 { }, 27 { },
27}; 28};
@@ -51,7 +52,6 @@ static void symbol_int_callback(struct urb *urb)
51 int status = urb->status; 52 int status = urb->status;
52 struct tty_struct *tty; 53 struct tty_struct *tty;
53 int result; 54 int result;
54 int available_room = 0;
55 int data_length; 55 int data_length;
56 56
57 dbg("%s - port %d", __func__, port->number); 57 dbg("%s - port %d", __func__, port->number);
@@ -89,18 +89,13 @@ static void symbol_int_callback(struct urb *urb)
89 */ 89 */
90 tty = tty_port_tty_get(&port->port); 90 tty = tty_port_tty_get(&port->port);
91 if (tty) { 91 if (tty) {
92 available_room = tty_buffer_request_room(tty, 92 tty_insert_flip_string(tty, &data[1], data_length);
93 data_length); 93 tty_flip_buffer_push(tty);
94 if (available_room) {
95 tty_insert_flip_string(tty, &data[1],
96 available_room);
97 tty_flip_buffer_push(tty);
98 }
99 tty_kref_put(tty); 94 tty_kref_put(tty);
100 } 95 }
101 } else { 96 } else {
102 dev_dbg(&priv->udev->dev, 97 dev_dbg(&priv->udev->dev,
103 "Improper ammount of data received from the device, " 98 "Improper amount of data received from the device, "
104 "%d bytes", urb->actual_length); 99 "%d bytes", urb->actual_length);
105 } 100 }
106 101