aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/Kconfig11
-rw-r--r--drivers/usb/serial/Makefile1
-rw-r--r--drivers/usb/serial/aircable.c9
-rw-r--r--drivers/usb/serial/airprime.c1
-rw-r--r--drivers/usb/serial/ark3116.c3
-rw-r--r--drivers/usb/serial/console.c6
-rw-r--r--drivers/usb/serial/cypress_m8.c9
-rw-r--r--drivers/usb/serial/ezusb.c3
-rw-r--r--drivers/usb/serial/ftdi_sio.c3
-rw-r--r--drivers/usb/serial/garmin_gps.c3
-rw-r--r--drivers/usb/serial/io_edgeport.c4
-rw-r--r--drivers/usb/serial/ipw.c3
-rw-r--r--drivers/usb/serial/keyspan.c18
-rw-r--r--drivers/usb/serial/kobil_sct.c9
-rw-r--r--drivers/usb/serial/mct_u232.c6
-rw-r--r--drivers/usb/serial/mos7840.c3
-rw-r--r--drivers/usb/serial/navman.c3
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.c5
-rw-r--r--drivers/usb/serial/ti_usb_3410_5052.h1
-rw-r--r--drivers/usb/serial/usb-serial.c12
-rw-r--r--drivers/usb/serial/usb_debug.c65
-rw-r--r--drivers/usb/serial/visor.c3
22 files changed, 117 insertions, 64 deletions
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 2a8dd4cc943d..2f4d303ee36f 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -554,6 +554,17 @@ config USB_SERIAL_OMNINET
554 To compile this driver as a module, choose M here: the 554 To compile this driver as a module, choose M here: the
555 module will be called omninet. 555 module will be called omninet.
556 556
557config USB_SERIAL_DEBUG
558 tristate "USB Debugging Device"
559 depends on USB_SERIAL
560 help
561 Say Y here if you have a USB debugging device used to recieve
562 debugging data from another machine. The most common of these
563 devices is the NetChip TurboCONNECT device.
564
565 To compile this driver as a module, choose M here: the
566 module will be called usb-debug.
567
557config USB_EZUSB 568config USB_EZUSB
558 bool 569 bool
559 depends on USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT 570 depends on USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile
index a5047dc599bb..61166ad450e6 100644
--- a/drivers/usb/serial/Makefile
+++ b/drivers/usb/serial/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o
18obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o 18obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o
19obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o 19obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o
20obj-$(CONFIG_USB_SERIAL_CYPRESS_M8) += cypress_m8.o 20obj-$(CONFIG_USB_SERIAL_CYPRESS_M8) += cypress_m8.o
21obj-$(CONFIG_USB_SERIAL_DEBUG) += usb_debug.o
21obj-$(CONFIG_USB_SERIAL_DIGI_ACCELEPORT) += digi_acceleport.o 22obj-$(CONFIG_USB_SERIAL_DIGI_ACCELEPORT) += digi_acceleport.o
22obj-$(CONFIG_USB_SERIAL_EDGEPORT) += io_edgeport.o 23obj-$(CONFIG_USB_SERIAL_EDGEPORT) += io_edgeport.o
23obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += io_ti.o 24obj-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += io_ti.o
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index 812275509137..b1b5707bc99a 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -270,8 +270,11 @@ static void aircable_read(void *params)
270 */ 270 */
271 tty = port->tty; 271 tty = port->tty;
272 272
273 if (!tty) 273 if (!tty) {
274 schedule_work(&priv->rx_work); 274 schedule_work(&priv->rx_work);
275 err("%s - No tty available", __FUNCTION__);
276 return ;
277 }
275 278
276 count = min(64, serial_buf_data_avail(priv->rx_buf)); 279 count = min(64, serial_buf_data_avail(priv->rx_buf));
277 280
@@ -305,9 +308,7 @@ static int aircable_probe(struct usb_serial *serial,
305 308
306 for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) { 309 for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
307 endpoint = &iface_desc->endpoint[i].desc; 310 endpoint = &iface_desc->endpoint[i].desc;
308 if (((endpoint->bEndpointAddress & 0x80) == 0x00) && 311 if (usb_endpoint_is_bulk_out(endpoint)) {
309 ((endpoint->bmAttributes & 3) == 0x02)) {
310 /* we found our bulk out endpoint */
311 dbg("found bulk out on endpoint %d", i); 312 dbg("found bulk out on endpoint %d", i);
312 ++num_bulk_out; 313 ++num_bulk_out;
313 } 314 }
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c
index 7f5d546da39a..96c73726d74a 100644
--- a/drivers/usb/serial/airprime.c
+++ b/drivers/usb/serial/airprime.c
@@ -19,6 +19,7 @@
19static struct usb_device_id id_table [] = { 19static struct usb_device_id id_table [] = {
20 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ 20 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */
21 { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */ 21 { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */
22 { USB_DEVICE(0x1410, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */
22 { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */ 23 { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */
23 { }, 24 { },
24}; 25};
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index ca52f12f0e24..863966c1c5ac 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -85,10 +85,9 @@ static int ark3116_attach(struct usb_serial *serial)
85 int i; 85 int i;
86 86
87 for (i = 0; i < serial->num_ports; ++i) { 87 for (i = 0; i < serial->num_ports; ++i) {
88 priv = kmalloc(sizeof (struct ark3116_private), GFP_KERNEL); 88 priv = kzalloc(sizeof(struct ark3116_private), GFP_KERNEL);
89 if (!priv) 89 if (!priv)
90 goto cleanup; 90 goto cleanup;
91 memset(priv, 0x00, sizeof (struct ark3116_private));
92 spin_lock_init(&priv->lock); 91 spin_lock_init(&priv->lock);
93 92
94 usb_set_serial_port_data(serial->port[i], priv); 93 usb_set_serial_port_data(serial->port[i], priv);
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 3a9073dbfe6a..7167728d764c 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -166,19 +166,17 @@ static int usb_console_setup(struct console *co, char *options)
166 if (serial->type->set_termios) { 166 if (serial->type->set_termios) {
167 /* build up a fake tty structure so that the open call has something 167 /* build up a fake tty structure so that the open call has something
168 * to look at to get the cflag value */ 168 * to look at to get the cflag value */
169 tty = kmalloc (sizeof (*tty), GFP_KERNEL); 169 tty = kzalloc(sizeof(*tty), GFP_KERNEL);
170 if (!tty) { 170 if (!tty) {
171 err ("no more memory"); 171 err ("no more memory");
172 return -ENOMEM; 172 return -ENOMEM;
173 } 173 }
174 termios = kmalloc (sizeof (*termios), GFP_KERNEL); 174 termios = kzalloc(sizeof(*termios), GFP_KERNEL);
175 if (!termios) { 175 if (!termios) {
176 err ("no more memory"); 176 err ("no more memory");
177 kfree (tty); 177 kfree (tty);
178 return -ENOMEM; 178 return -ENOMEM;
179 } 179 }
180 memset (tty, 0x00, sizeof(*tty));
181 memset (termios, 0x00, sizeof(*termios));
182 termios->c_cflag = cflag; 180 termios->c_cflag = cflag;
183 tty->termios = termios; 181 tty->termios = termios;
184 port->tty = tty; 182 port->tty = tty;
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index f2e89a083659..093f303b3189 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -1684,15 +1684,14 @@ static int __init cypress_init(void)
1684 1684
1685 info(DRIVER_DESC " " DRIVER_VERSION); 1685 info(DRIVER_DESC " " DRIVER_VERSION);
1686 return 0; 1686 return 0;
1687
1687failed_usb_register: 1688failed_usb_register:
1688 usb_deregister(&cypress_driver);
1689failed_ca42v2_register:
1690 usb_serial_deregister(&cypress_ca42v2_device); 1689 usb_serial_deregister(&cypress_ca42v2_device);
1691failed_hidcom_register: 1690failed_ca42v2_register:
1692 usb_serial_deregister(&cypress_hidcom_device); 1691 usb_serial_deregister(&cypress_hidcom_device);
1693failed_em_register: 1692failed_hidcom_register:
1694 usb_serial_deregister(&cypress_earthmate_device); 1693 usb_serial_deregister(&cypress_earthmate_device);
1695 1694failed_em_register:
1696 return retval; 1695 return retval;
1697} 1696}
1698 1697
diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c
index 5169c2d154ab..97ee718b1da2 100644
--- a/drivers/usb/serial/ezusb.c
+++ b/drivers/usb/serial/ezusb.c
@@ -31,12 +31,11 @@ int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *da
31 return -ENODEV; 31 return -ENODEV;
32 } 32 }
33 33
34 transfer_buffer = kmalloc (length, GFP_KERNEL); 34 transfer_buffer = kmemdup(data, length, GFP_KERNEL);
35 if (!transfer_buffer) { 35 if (!transfer_buffer) {
36 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, length); 36 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, length);
37 return -ENOMEM; 37 return -ENOMEM;
38 } 38 }
39 memcpy (transfer_buffer, data, length);
40 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), bRequest, 0x40, address, 0, transfer_buffer, length, 3000); 39 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), bRequest, 0x40, address, 0, transfer_buffer, length, 3000);
41 kfree (transfer_buffer); 40 kfree (transfer_buffer);
42 return result; 41 return result;
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c186b4e73c72..89ce2775be15 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1388,8 +1388,7 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
1388 flush_scheduled_work(); 1388 flush_scheduled_work();
1389 1389
1390 /* shutdown our bulk read */ 1390 /* shutdown our bulk read */
1391 if (port->read_urb) 1391 usb_kill_urb(port->read_urb);
1392 usb_kill_urb(port->read_urb);
1393} /* ftdi_close */ 1392} /* ftdi_close */
1394 1393
1395 1394
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index 4543152a9966..6530d391ebed 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -1523,12 +1523,11 @@ static int garmin_attach (struct usb_serial *serial)
1523 1523
1524 dbg("%s", __FUNCTION__); 1524 dbg("%s", __FUNCTION__);
1525 1525
1526 garmin_data_p = kmalloc (sizeof(struct garmin_data), GFP_KERNEL); 1526 garmin_data_p = kzalloc(sizeof(struct garmin_data), GFP_KERNEL);
1527 if (garmin_data_p == NULL) { 1527 if (garmin_data_p == NULL) {
1528 dev_err(&port->dev, "%s - Out of memory\n", __FUNCTION__); 1528 dev_err(&port->dev, "%s - Out of memory\n", __FUNCTION__);
1529 return -ENOMEM; 1529 return -ENOMEM;
1530 } 1530 }
1531 memset (garmin_data_p, 0, sizeof(struct garmin_data));
1532 init_timer(&garmin_data_p->timer); 1531 init_timer(&garmin_data_p->timer);
1533 spin_lock_init(&garmin_data_p->lock); 1532 spin_lock_init(&garmin_data_p->lock);
1534 INIT_LIST_HEAD(&garmin_data_p->pktlist); 1533 INIT_LIST_HEAD(&garmin_data_p->pktlist);
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 91bd3014ef1e..d06547a13f28 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -1038,9 +1038,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
1038 edge_port->open = FALSE; 1038 edge_port->open = FALSE;
1039 edge_port->openPending = FALSE; 1039 edge_port->openPending = FALSE;
1040 1040
1041 if (edge_port->write_urb) { 1041 usb_kill_urb(edge_port->write_urb);
1042 usb_kill_urb(edge_port->write_urb);
1043 }
1044 1042
1045 if (edge_port->write_urb) { 1043 if (edge_port->write_urb) {
1046 /* if this urb had a transfer buffer already (old transfer) free it */ 1044 /* if this urb had a transfer buffer already (old transfer) free it */
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index 2a4bb66691ad..d3b9a351cef8 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -206,10 +206,9 @@ static int ipw_open(struct usb_serial_port *port, struct file *filp)
206 206
207 dbg("%s", __FUNCTION__); 207 dbg("%s", __FUNCTION__);
208 208
209 buf_flow_init = kmalloc(16, GFP_KERNEL); 209 buf_flow_init = kmemdup(buf_flow_static, 16, GFP_KERNEL);
210 if (!buf_flow_init) 210 if (!buf_flow_init)
211 return -ENOMEM; 211 return -ENOMEM;
212 memcpy(buf_flow_init, buf_flow_static, 16);
213 212
214 if (port->tty) 213 if (port->tty)
215 port->tty->low_latency = 1; 214 port->tty->low_latency = 1;
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index 53be824eb1bf..7639652cec42 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -2306,22 +2306,16 @@ static void keyspan_shutdown (struct usb_serial *serial)
2306 } 2306 }
2307 2307
2308 /* Now free them */ 2308 /* Now free them */
2309 if (s_priv->instat_urb) 2309 usb_free_urb(s_priv->instat_urb);
2310 usb_free_urb(s_priv->instat_urb); 2310 usb_free_urb(s_priv->glocont_urb);
2311 if (s_priv->glocont_urb)
2312 usb_free_urb(s_priv->glocont_urb);
2313 for (i = 0; i < serial->num_ports; ++i) { 2311 for (i = 0; i < serial->num_ports; ++i) {
2314 port = serial->port[i]; 2312 port = serial->port[i];
2315 p_priv = usb_get_serial_port_data(port); 2313 p_priv = usb_get_serial_port_data(port);
2316 if (p_priv->inack_urb) 2314 usb_free_urb(p_priv->inack_urb);
2317 usb_free_urb(p_priv->inack_urb); 2315 usb_free_urb(p_priv->outcont_urb);
2318 if (p_priv->outcont_urb)
2319 usb_free_urb(p_priv->outcont_urb);
2320 for (j = 0; j < 2; j++) { 2316 for (j = 0; j < 2; j++) {
2321 if (p_priv->in_urbs[j]) 2317 usb_free_urb(p_priv->in_urbs[j]);
2322 usb_free_urb(p_priv->in_urbs[j]); 2318 usb_free_urb(p_priv->out_urbs[j]);
2323 if (p_priv->out_urbs[j])
2324 usb_free_urb(p_priv->out_urbs[j]);
2325 } 2319 }
2326 } 2320 }
2327 2321
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index ff03331e0bcf..237289920f03 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -185,13 +185,11 @@ static int kobil_startup (struct usb_serial *serial)
185 185
186 for (i = 0; i < altsetting->desc.bNumEndpoints; i++) { 186 for (i = 0; i < altsetting->desc.bNumEndpoints; i++) {
187 endpoint = &altsetting->endpoint[i]; 187 endpoint = &altsetting->endpoint[i];
188 if (((endpoint->desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT) && 188 if (usb_endpoint_is_int_out(&endpoint->desc)) {
189 ((endpoint->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)) {
190 dbg("%s Found interrupt out endpoint. Address: %d", __FUNCTION__, endpoint->desc.bEndpointAddress); 189 dbg("%s Found interrupt out endpoint. Address: %d", __FUNCTION__, endpoint->desc.bEndpointAddress);
191 priv->write_int_endpoint_address = endpoint->desc.bEndpointAddress; 190 priv->write_int_endpoint_address = endpoint->desc.bEndpointAddress;
192 } 191 }
193 if (((endpoint->desc.bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN) && 192 if (usb_endpoint_is_int_in(&endpoint->desc)) {
194 ((endpoint->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT)) {
195 dbg("%s Found interrupt in endpoint. Address: %d", __FUNCTION__, endpoint->desc.bEndpointAddress); 193 dbg("%s Found interrupt in endpoint. Address: %d", __FUNCTION__, endpoint->desc.bEndpointAddress);
196 priv->read_int_endpoint_address = endpoint->desc.bEndpointAddress; 194 priv->read_int_endpoint_address = endpoint->desc.bEndpointAddress;
197 } 195 }
@@ -355,8 +353,7 @@ static void kobil_close (struct usb_serial_port *port, struct file *filp)
355 usb_free_urb( port->write_urb ); 353 usb_free_urb( port->write_urb );
356 port->write_urb = NULL; 354 port->write_urb = NULL;
357 } 355 }
358 if (port->interrupt_in_urb) 356 usb_kill_urb(port->interrupt_in_urb);
359 usb_kill_urb(port->interrupt_in_urb);
360} 357}
361 358
362 359
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index b7582cc496dc..a906e500a02b 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -358,10 +358,8 @@ static int mct_u232_startup (struct usb_serial *serial)
358 /* Puh, that's dirty */ 358 /* Puh, that's dirty */
359 port = serial->port[0]; 359 port = serial->port[0];
360 rport = serial->port[1]; 360 rport = serial->port[1];
361 if (port->read_urb) { 361 /* No unlinking, it wasn't submitted yet. */
362 /* No unlinking, it wasn't submitted yet. */ 362 usb_free_urb(port->read_urb);
363 usb_free_urb(port->read_urb);
364 }
365 port->read_urb = rport->interrupt_in_urb; 363 port->read_urb = rport->interrupt_in_urb;
366 rport->interrupt_in_urb = NULL; 364 rport->interrupt_in_urb = NULL;
367 port->read_urb->context = port; 365 port->read_urb->context = port;
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 5b71962d0351..02c89e10b2cf 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2596,12 +2596,11 @@ static int mos7840_startup(struct usb_serial *serial)
2596 2596
2597 /* set up port private structures */ 2597 /* set up port private structures */
2598 for (i = 0; i < serial->num_ports; ++i) { 2598 for (i = 0; i < serial->num_ports; ++i) {
2599 mos7840_port = kmalloc(sizeof(struct moschip_port), GFP_KERNEL); 2599 mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
2600 if (mos7840_port == NULL) { 2600 if (mos7840_port == NULL) {
2601 err("%s - Out of memory", __FUNCTION__); 2601 err("%s - Out of memory", __FUNCTION__);
2602 return -ENOMEM; 2602 return -ENOMEM;
2603 } 2603 }
2604 memset(mos7840_port, 0, sizeof(struct moschip_port));
2605 2604
2606 /* Initialize all port interrupt end point to port 0 int endpoint * 2605 /* Initialize all port interrupt end point to port 0 int endpoint *
2607 * Our device has only one interrupt end point comman to all port */ 2606 * Our device has only one interrupt end point comman to all port */
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
index 0610409a6568..054abee81652 100644
--- a/drivers/usb/serial/navman.c
+++ b/drivers/usb/serial/navman.c
@@ -95,8 +95,7 @@ static void navman_close(struct usb_serial_port *port, struct file *filp)
95{ 95{
96 dbg("%s - port %d", __FUNCTION__, port->number); 96 dbg("%s - port %d", __FUNCTION__, port->number);
97 97
98 if (port->interrupt_in_urb) 98 usb_kill_urb(port->interrupt_in_urb);
99 usb_kill_urb(port->interrupt_in_urb);
100} 99}
101 100
102static int navman_write(struct usb_serial_port *port, 101static int navman_write(struct usb_serial_port *port,
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 07400c0c8a8c..ae98d8cbdbb8 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -228,6 +228,7 @@ static int product_5052_count;
228/* null entry */ 228/* null entry */
229static struct usb_device_id ti_id_table_3410[1+TI_EXTRA_VID_PID_COUNT+1] = { 229static struct usb_device_id ti_id_table_3410[1+TI_EXTRA_VID_PID_COUNT+1] = {
230 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, 230 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
231 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
231}; 232};
232 233
233static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = { 234static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = {
@@ -239,6 +240,7 @@ static struct usb_device_id ti_id_table_5052[4+TI_EXTRA_VID_PID_COUNT+1] = {
239 240
240static struct usb_device_id ti_id_table_combined[] = { 241static struct usb_device_id ti_id_table_combined[] = {
241 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) }, 242 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
243 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
242 { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) }, 244 { USB_DEVICE(TI_VENDOR_ID, TI_5052_BOOT_PRODUCT_ID) },
243 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) }, 245 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
244 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) }, 246 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
@@ -459,13 +461,12 @@ static int ti_startup(struct usb_serial *serial)
459 461
460 /* set up port structures */ 462 /* set up port structures */
461 for (i = 0; i < serial->num_ports; ++i) { 463 for (i = 0; i < serial->num_ports; ++i) {
462 tport = kmalloc(sizeof(struct ti_port), GFP_KERNEL); 464 tport = kzalloc(sizeof(struct ti_port), GFP_KERNEL);
463 if (tport == NULL) { 465 if (tport == NULL) {
464 dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__); 466 dev_err(&dev->dev, "%s - out of memory\n", __FUNCTION__);
465 status = -ENOMEM; 467 status = -ENOMEM;
466 goto free_tports; 468 goto free_tports;
467 } 469 }
468 memset(tport, 0, sizeof(struct ti_port));
469 spin_lock_init(&tport->tp_lock); 470 spin_lock_init(&tport->tp_lock);
470 tport->tp_uart_base_addr = (i == 0 ? TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR); 471 tport->tp_uart_base_addr = (i == 0 ? TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR);
471 tport->tp_flags = low_latency ? ASYNC_LOW_LATENCY : 0; 472 tport->tp_flags = low_latency ? ASYNC_LOW_LATENCY : 0;
diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h
index 02c1aeb9e1b8..b5541bf991ba 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.h
+++ b/drivers/usb/serial/ti_usb_3410_5052.h
@@ -28,6 +28,7 @@
28/* Vendor and product ids */ 28/* Vendor and product ids */
29#define TI_VENDOR_ID 0x0451 29#define TI_VENDOR_ID 0x0451
30#define TI_3410_PRODUCT_ID 0x3410 30#define TI_3410_PRODUCT_ID 0x3410
31#define TI_3410_EZ430_ID 0xF430 /* TI ez430 development tool */
31#define TI_5052_BOOT_PRODUCT_ID 0x5052 /* no EEPROM, no firmware */ 32#define TI_5052_BOOT_PRODUCT_ID 0x5052 /* no EEPROM, no firmware */
32#define TI_5152_BOOT_PRODUCT_ID 0x5152 /* no EEPROM, no firmware */ 33#define TI_5152_BOOT_PRODUCT_ID 0x5152 /* no EEPROM, no firmware */
33#define TI_5052_EEPROM_PRODUCT_ID 0x505A /* EEPROM, no firmware */ 34#define TI_5052_EEPROM_PRODUCT_ID 0x505A /* EEPROM, no firmware */
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 8006e51c34bb..c1257d5292f5 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -952,32 +952,28 @@ probe_error:
952 port = serial->port[i]; 952 port = serial->port[i];
953 if (!port) 953 if (!port)
954 continue; 954 continue;
955 if (port->read_urb) 955 usb_free_urb(port->read_urb);
956 usb_free_urb (port->read_urb);
957 kfree(port->bulk_in_buffer); 956 kfree(port->bulk_in_buffer);
958 } 957 }
959 for (i = 0; i < num_bulk_out; ++i) { 958 for (i = 0; i < num_bulk_out; ++i) {
960 port = serial->port[i]; 959 port = serial->port[i];
961 if (!port) 960 if (!port)
962 continue; 961 continue;
963 if (port->write_urb) 962 usb_free_urb(port->write_urb);
964 usb_free_urb (port->write_urb);
965 kfree(port->bulk_out_buffer); 963 kfree(port->bulk_out_buffer);
966 } 964 }
967 for (i = 0; i < num_interrupt_in; ++i) { 965 for (i = 0; i < num_interrupt_in; ++i) {
968 port = serial->port[i]; 966 port = serial->port[i];
969 if (!port) 967 if (!port)
970 continue; 968 continue;
971 if (port->interrupt_in_urb) 969 usb_free_urb(port->interrupt_in_urb);
972 usb_free_urb (port->interrupt_in_urb);
973 kfree(port->interrupt_in_buffer); 970 kfree(port->interrupt_in_buffer);
974 } 971 }
975 for (i = 0; i < num_interrupt_out; ++i) { 972 for (i = 0; i < num_interrupt_out; ++i) {
976 port = serial->port[i]; 973 port = serial->port[i];
977 if (!port) 974 if (!port)
978 continue; 975 continue;
979 if (port->interrupt_out_urb) 976 usb_free_urb(port->interrupt_out_urb);
980 usb_free_urb (port->interrupt_out_urb);
981 kfree(port->interrupt_out_buffer); 977 kfree(port->interrupt_out_buffer);
982 } 978 }
983 979
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c
new file mode 100644
index 000000000000..257a5e436873
--- /dev/null
+++ b/drivers/usb/serial/usb_debug.c
@@ -0,0 +1,65 @@
1/*
2 * USB Debug cable driver
3 *
4 * Copyright (C) 2006 Greg Kroah-Hartman <greg@kroah.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/tty.h>
14#include <linux/module.h>
15#include <linux/usb.h>
16#include <linux/usb/serial.h>
17
18static struct usb_device_id id_table [] = {
19 { USB_DEVICE(0x0525, 0x127a) },
20 { },
21};
22MODULE_DEVICE_TABLE(usb, id_table);
23
24static struct usb_driver debug_driver = {
25 .name = "debug",
26 .probe = usb_serial_probe,
27 .disconnect = usb_serial_disconnect,
28 .id_table = id_table,
29 .no_dynamic_id = 1,
30};
31
32static struct usb_serial_driver debug_device = {
33 .driver = {
34 .owner = THIS_MODULE,
35 .name = "debug",
36 },
37 .id_table = id_table,
38 .num_interrupt_in = NUM_DONT_CARE,
39 .num_bulk_in = NUM_DONT_CARE,
40 .num_bulk_out = NUM_DONT_CARE,
41 .num_ports = 1,
42};
43
44static int __init debug_init(void)
45{
46 int retval;
47
48 retval = usb_serial_register(&debug_device);
49 if (retval)
50 return retval;
51 retval = usb_register(&debug_driver);
52 if (retval)
53 usb_serial_deregister(&debug_device);
54 return retval;
55}
56
57static void __exit debug_exit(void)
58{
59 usb_deregister(&debug_driver);
60 usb_serial_deregister(&debug_device);
61}
62
63module_init(debug_init);
64module_exit(debug_exit);
65MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
index befe2e11a041..eef5eaa5fa0b 100644
--- a/drivers/usb/serial/visor.c
+++ b/drivers/usb/serial/visor.c
@@ -348,8 +348,7 @@ static void visor_close (struct usb_serial_port *port, struct file * filp)
348 348
349 /* shutdown our urbs */ 349 /* shutdown our urbs */
350 usb_kill_urb(port->read_urb); 350 usb_kill_urb(port->read_urb);
351 if (port->interrupt_in_urb) 351 usb_kill_urb(port->interrupt_in_urb);
352 usb_kill_urb(port->interrupt_in_urb);
353 352
354 /* Try to send shutdown message, if the device is gone, this will just fail. */ 353 /* Try to send shutdown message, if the device is gone, this will just fail. */
355 transfer_buffer = kmalloc (0x12, GFP_KERNEL); 354 transfer_buffer = kmalloc (0x12, GFP_KERNEL);