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

USB: misc: iowarrior: 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>
上级 84346269
...@@ -158,9 +158,10 @@ static void iowarrior_callback(struct urb *urb) ...@@ -158,9 +158,10 @@ static void iowarrior_callback(struct urb *urb)
int read_idx; int read_idx;
int aux_idx; int aux_idx;
int offset; int offset;
int status; int status = urb->status;
int retval;
switch (urb->status) { switch (status) {
case 0: case 0:
/* success */ /* success */
break; break;
...@@ -213,10 +214,10 @@ static void iowarrior_callback(struct urb *urb) ...@@ -213,10 +214,10 @@ static void iowarrior_callback(struct urb *urb)
wake_up_interruptible(&dev->read_wait); wake_up_interruptible(&dev->read_wait);
exit: exit:
status = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC);
if (status) if (retval)
dev_err(&dev->interface->dev, "%s - usb_submit_urb failed with result %d", dev_err(&dev->interface->dev, "%s - usb_submit_urb failed with result %d",
__FUNCTION__, status); __FUNCTION__, retval);
} }
...@@ -226,13 +227,15 @@ static void iowarrior_callback(struct urb *urb) ...@@ -226,13 +227,15 @@ static void iowarrior_callback(struct urb *urb)
static void iowarrior_write_callback(struct urb *urb) static void iowarrior_write_callback(struct urb *urb)
{ {
struct iowarrior *dev; struct iowarrior *dev;
int status = urb->status;
dev = (struct iowarrior *)urb->context; dev = (struct iowarrior *)urb->context;
/* sync/async unlink faults aren't errors */ /* sync/async unlink faults aren't errors */
if (urb->status && if (status &&
!(urb->status == -ENOENT || !(status == -ENOENT ||
urb->status == -ECONNRESET || urb->status == -ESHUTDOWN)) { status == -ECONNRESET || status == -ESHUTDOWN)) {
dbg("%s - nonzero write bulk status received: %d", dbg("%s - nonzero write bulk status received: %d",
__func__, urb->status); __func__, status);
} }
/* free up our allocated buffer */ /* free up our allocated buffer */
usb_buffer_free(urb->dev, urb->transfer_buffer_length, usb_buffer_free(urb->dev, urb->transfer_buffer_length,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册