aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2014-01-02 16:49:33 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-03 15:42:24 -0500
commit271ec2d2d7bd4ab528a7a94701503df06ca8fd52 (patch)
tree4e7ced5a15530fc74bfa0f0e389556bd757a69ea
parent5e409a265d9327689eef15a8fff1ffcb7f8fc2e1 (diff)
USB: ch341: clean up interrupt handler
Clean up interrupt completion handler somewhat. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/serial/ch341.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index ac21618ace19..65a81c64bf7b 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -484,9 +484,9 @@ static void ch341_update_line_status(struct usb_serial_port *port,
484 484
485static void ch341_read_int_callback(struct urb *urb) 485static void ch341_read_int_callback(struct urb *urb)
486{ 486{
487 struct usb_serial_port *port = (struct usb_serial_port *) urb->context; 487 struct usb_serial_port *port = urb->context;
488 unsigned char *data = urb->transfer_buffer; 488 unsigned char *data = urb->transfer_buffer;
489 unsigned int actual_length = urb->actual_length; 489 unsigned int len = urb->actual_length;
490 int status; 490 int status;
491 491
492 switch (urb->status) { 492 switch (urb->status) {
@@ -497,24 +497,23 @@ static void ch341_read_int_callback(struct urb *urb)
497 case -ENOENT: 497 case -ENOENT:
498 case -ESHUTDOWN: 498 case -ESHUTDOWN:
499 /* this urb is terminated, clean up */ 499 /* this urb is terminated, clean up */
500 dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n", 500 dev_dbg(&urb->dev->dev, "%s - urb shutting down: %d\n",
501 __func__, urb->status); 501 __func__, urb->status);
502 return; 502 return;
503 default: 503 default:
504 dev_dbg(&urb->dev->dev, "%s - nonzero urb status received: %d\n", 504 dev_dbg(&urb->dev->dev, "%s - nonzero urb status: %d\n",
505 __func__, urb->status); 505 __func__, urb->status);
506 goto exit; 506 goto exit;
507 } 507 }
508 508
509 usb_serial_debug_data(&port->dev, __func__, 509 usb_serial_debug_data(&port->dev, __func__, len, data);
510 urb->actual_length, urb->transfer_buffer); 510 ch341_update_line_status(port, data, len);
511 ch341_update_line_status(port, data, actual_length);
512exit: 511exit:
513 status = usb_submit_urb(urb, GFP_ATOMIC); 512 status = usb_submit_urb(urb, GFP_ATOMIC);
514 if (status) 513 if (status) {
515 dev_err(&urb->dev->dev, 514 dev_err(&urb->dev->dev, "%s - usb_submit_urb failed: %d\n",
516 "%s - usb_submit_urb failed with result %d\n",
517 __func__, status); 515 __func__, status);
516 }
518} 517}
519 518
520static int ch341_tiocmget(struct tty_struct *tty) 519static int ch341_tiocmget(struct tty_struct *tty)