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

USB: misc: adtux: 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>
上级 3fc3e826
...@@ -179,17 +179,18 @@ static void adu_delete(struct adu_device *dev) ...@@ -179,17 +179,18 @@ static void adu_delete(struct adu_device *dev)
static void adu_interrupt_in_callback(struct urb *urb) static void adu_interrupt_in_callback(struct urb *urb)
{ {
struct adu_device *dev = urb->context; struct adu_device *dev = urb->context;
int status = urb->status;
dbg(4," %s : enter, status %d", __FUNCTION__, urb->status); dbg(4," %s : enter, status %d", __FUNCTION__, status);
adu_debug_data(5, __FUNCTION__, urb->actual_length, adu_debug_data(5, __FUNCTION__, urb->actual_length,
urb->transfer_buffer); urb->transfer_buffer);
spin_lock(&dev->buflock); spin_lock(&dev->buflock);
if (urb->status != 0) { if (status != 0) {
if ((urb->status != -ENOENT) && (urb->status != -ECONNRESET)) { if ((status != -ENOENT) && (status != -ECONNRESET)) {
dbg(1," %s : nonzero status received: %d", dbg(1," %s : nonzero status received: %d",
__FUNCTION__, urb->status); __FUNCTION__, status);
} }
goto exit; goto exit;
} }
...@@ -217,21 +218,22 @@ static void adu_interrupt_in_callback(struct urb *urb) ...@@ -217,21 +218,22 @@ static void adu_interrupt_in_callback(struct urb *urb)
wake_up_interruptible(&dev->read_wait); wake_up_interruptible(&dev->read_wait);
adu_debug_data(5, __FUNCTION__, urb->actual_length, adu_debug_data(5, __FUNCTION__, urb->actual_length,
urb->transfer_buffer); urb->transfer_buffer);
dbg(4," %s : leave, status %d", __FUNCTION__, urb->status); dbg(4," %s : leave, status %d", __FUNCTION__, status);
} }
static void adu_interrupt_out_callback(struct urb *urb) static void adu_interrupt_out_callback(struct urb *urb)
{ {
struct adu_device *dev = urb->context; struct adu_device *dev = urb->context;
int status = urb->status;
dbg(4," %s : enter, status %d", __FUNCTION__, urb->status); dbg(4," %s : enter, status %d", __FUNCTION__, status);
adu_debug_data(5,__FUNCTION__, urb->actual_length, urb->transfer_buffer); adu_debug_data(5,__FUNCTION__, urb->actual_length, urb->transfer_buffer);
if (urb->status != 0) { if (status != 0) {
if ((urb->status != -ENOENT) && if ((status != -ENOENT) &&
(urb->status != -ECONNRESET)) { (status != -ECONNRESET)) {
dbg(1, " %s :nonzero status received: %d", dbg(1, " %s :nonzero status received: %d",
__FUNCTION__, urb->status); __FUNCTION__, status);
} }
goto exit; goto exit;
} }
...@@ -241,7 +243,7 @@ static void adu_interrupt_out_callback(struct urb *urb) ...@@ -241,7 +243,7 @@ static void adu_interrupt_out_callback(struct urb *urb)
adu_debug_data(5, __FUNCTION__, urb->actual_length, adu_debug_data(5, __FUNCTION__, urb->actual_length,
urb->transfer_buffer); urb->transfer_buffer);
dbg(4," %s : leave, status %d", __FUNCTION__, urb->status); dbg(4," %s : leave, status %d", __FUNCTION__, status);
} }
static int adu_open(struct inode *inode, struct file *file) static int adu_open(struct inode *inode, struct file *file)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册