aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/aircable.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/aircable.c')
-rw-r--r--drivers/usb/serial/aircable.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index b10ac8409411..4fd7af98b1ae 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -43,6 +43,7 @@
43 */ 43 */
44 44
45#include <linux/tty.h> 45#include <linux/tty.h>
46#include <linux/slab.h>
46#include <linux/tty_flip.h> 47#include <linux/tty_flip.h>
47#include <linux/circ_buf.h> 48#include <linux/circ_buf.h>
48#include <linux/usb.h> 49#include <linux/usb.h>
@@ -78,7 +79,7 @@ static int debug;
78#define DRIVER_DESC "AIRcable USB Driver" 79#define DRIVER_DESC "AIRcable USB Driver"
79 80
80/* ID table that will be registered with USB core */ 81/* ID table that will be registered with USB core */
81static struct usb_device_id id_table [] = { 82static const struct usb_device_id id_table[] = {
82 { USB_DEVICE(AIRCABLE_VID, AIRCABLE_USB_PID) }, 83 { USB_DEVICE(AIRCABLE_VID, AIRCABLE_USB_PID) },
83 { }, 84 { },
84}; 85};
@@ -468,10 +469,6 @@ static void aircable_read_bulk_callback(struct urb *urb)
468 469
469 if (status) { 470 if (status) {
470 dbg("%s - urb status = %d", __func__, status); 471 dbg("%s - urb status = %d", __func__, status);
471 if (!port->port.count) {
472 dbg("%s - port is closed, exiting.", __func__);
473 return;
474 }
475 if (status == -EPROTO) { 472 if (status == -EPROTO) {
476 dbg("%s - caught -EPROTO, resubmitting the urb", 473 dbg("%s - caught -EPROTO, resubmitting the urb",
477 __func__); 474 __func__);
@@ -530,23 +527,19 @@ static void aircable_read_bulk_callback(struct urb *urb)
530 } 527 }
531 tty_kref_put(tty); 528 tty_kref_put(tty);
532 529
533 /* Schedule the next read _if_ we are still open */ 530 /* Schedule the next read */
534 if (port->port.count) { 531 usb_fill_bulk_urb(port->read_urb, port->serial->dev,
535 usb_fill_bulk_urb(port->read_urb, port->serial->dev, 532 usb_rcvbulkpipe(port->serial->dev,
536 usb_rcvbulkpipe(port->serial->dev, 533 port->bulk_in_endpointAddress),
537 port->bulk_in_endpointAddress), 534 port->read_urb->transfer_buffer,
538 port->read_urb->transfer_buffer, 535 port->read_urb->transfer_buffer_length,
539 port->read_urb->transfer_buffer_length, 536 aircable_read_bulk_callback, port);
540 aircable_read_bulk_callback, port); 537
541 538 result = usb_submit_urb(urb, GFP_ATOMIC);
542 result = usb_submit_urb(urb, GFP_ATOMIC); 539 if (result && result != -EPERM)
543 if (result) 540 dev_err(&urb->dev->dev,
544 dev_err(&urb->dev->dev, 541 "%s - failed resubmitting read urb, error %d\n",
545 "%s - failed resubmitting read urb, error %d\n", 542 __func__, result);
546 __func__, result);
547 }
548
549 return;
550} 543}
551 544
552/* Based on ftdi_sio.c throttle */ 545/* Based on ftdi_sio.c throttle */