提交 64771a0f 编写于 作者: G Greg Kroah-Hartman

USB: misc: legousbtower: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 491c021e
...@@ -742,19 +742,20 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t ...@@ -742,19 +742,20 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
static void tower_interrupt_in_callback (struct urb *urb) static void tower_interrupt_in_callback (struct urb *urb)
{ {
struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context; struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context;
int status = urb->status;
int retval; int retval;
dbg(4, "%s: enter, status %d", __FUNCTION__, urb->status); dbg(4, "%s: enter, status %d", __FUNCTION__, status);
lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
if (urb->status) { if (status) {
if (urb->status == -ENOENT || if (status == -ENOENT ||
urb->status == -ECONNRESET || status == -ECONNRESET ||
urb->status == -ESHUTDOWN) { status == -ESHUTDOWN) {
goto exit; goto exit;
} else { } else {
dbg(1, "%s: nonzero status received: %d", __FUNCTION__, urb->status); dbg(1, "%s: nonzero status received: %d", __FUNCTION__, status);
goto resubmit; /* maybe we can recover */ goto resubmit; /* maybe we can recover */
} }
} }
...@@ -788,7 +789,7 @@ static void tower_interrupt_in_callback (struct urb *urb) ...@@ -788,7 +789,7 @@ static void tower_interrupt_in_callback (struct urb *urb)
wake_up_interruptible (&dev->read_wait); wake_up_interruptible (&dev->read_wait);
lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
dbg(4, "%s: leave, status %d", __FUNCTION__, urb->status); dbg(4, "%s: leave, status %d", __FUNCTION__, status);
} }
...@@ -798,23 +799,24 @@ static void tower_interrupt_in_callback (struct urb *urb) ...@@ -798,23 +799,24 @@ static void tower_interrupt_in_callback (struct urb *urb)
static void tower_interrupt_out_callback (struct urb *urb) static void tower_interrupt_out_callback (struct urb *urb)
{ {
struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context; struct lego_usb_tower *dev = (struct lego_usb_tower *)urb->context;
int status = urb->status;
dbg(4, "%s: enter, status %d", __FUNCTION__, urb->status); dbg(4, "%s: enter, status %d", __FUNCTION__, status);
lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
/* sync/async unlink faults aren't errors */ /* sync/async unlink faults aren't errors */
if (urb->status && !(urb->status == -ENOENT || if (status && !(status == -ENOENT ||
urb->status == -ECONNRESET || status == -ECONNRESET ||
urb->status == -ESHUTDOWN)) { status == -ESHUTDOWN)) {
dbg(1, "%s - nonzero write bulk status received: %d", dbg(1, "%s - nonzero write bulk status received: %d",
__FUNCTION__, urb->status); __FUNCTION__, status);
} }
dev->interrupt_out_busy = 0; dev->interrupt_out_busy = 0;
wake_up_interruptible(&dev->write_wait); wake_up_interruptible(&dev->write_wait);
lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer); lego_usb_tower_debug_data(5, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
dbg(4, "%s: leave, status %d", __FUNCTION__, urb->status); dbg(4, "%s: leave, status %d", __FUNCTION__, status);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册