Commit 271ec2d2 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: ch341: clean up interrupt handler

Clean up interrupt completion handler somewhat.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5e409a26
...@@ -484,9 +484,9 @@ static void ch341_update_line_status(struct usb_serial_port *port, ...@@ -484,9 +484,9 @@ static void ch341_update_line_status(struct usb_serial_port *port,
static void ch341_read_int_callback(struct urb *urb) static void ch341_read_int_callback(struct urb *urb)
{ {
struct usb_serial_port *port = (struct usb_serial_port *) urb->context; struct usb_serial_port *port = urb->context;
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
unsigned int actual_length = urb->actual_length; unsigned int len = urb->actual_length;
int status; int status;
switch (urb->status) { switch (urb->status) {
...@@ -497,24 +497,23 @@ static void ch341_read_int_callback(struct urb *urb) ...@@ -497,24 +497,23 @@ static void ch341_read_int_callback(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* this urb is terminated, clean up */
dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n", dev_dbg(&urb->dev->dev, "%s - urb shutting down: %d\n",
__func__, urb->status); __func__, urb->status);
return; return;
default: default:
dev_dbg(&urb->dev->dev, "%s - nonzero urb status received: %d\n", dev_dbg(&urb->dev->dev, "%s - nonzero urb status: %d\n",
__func__, urb->status); __func__, urb->status);
goto exit; goto exit;
} }
usb_serial_debug_data(&port->dev, __func__, usb_serial_debug_data(&port->dev, __func__, len, data);
urb->actual_length, urb->transfer_buffer); ch341_update_line_status(port, data, len);
ch341_update_line_status(port, data, actual_length);
exit: exit:
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status) if (status) {
dev_err(&urb->dev->dev, dev_err(&urb->dev->dev, "%s - usb_submit_urb failed: %d\n",
"%s - usb_submit_urb failed with result %d\n",
__func__, status); __func__, status);
}
} }
static int ch341_tiocmget(struct tty_struct *tty) static int ch341_tiocmget(struct tty_struct *tty)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment