diff options
Diffstat (limited to 'drivers/staging/vt6656/usbpipe.c')
-rw-r--r-- | drivers/staging/vt6656/usbpipe.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 351a99f3d684..f546553de66f 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -101,9 +101,9 @@ void vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data) static void vnt_start_interrupt_urb_complete(struct urb *urb) { struct vnt_private *priv = urb->context; - int status; + int status = urb->status; - switch (urb->status) { + switch (status) { case 0: case -ETIMEDOUT: break; @@ -116,9 +116,7 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb) break; } - status = urb->status; - - if (status != STATUS_SUCCESS) { + if (status) { priv->int_buf.in_use = false; dev_dbg(&priv->usb->dev, "%s status = %d\n", __func__, status); @@ -207,10 +205,9 @@ static void vnt_submit_rx_urb_complete(struct urb *urb) int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) { int status = 0; - struct urb *urb; + struct urb *urb = rcb->urb; - urb = rcb->urb; - if (rcb->skb == NULL) { + if (!rcb->skb) { dev_dbg(&priv->usb->dev, "rcb->skb is null\n"); return status; } @@ -224,7 +221,7 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb) rcb); status = usb_submit_urb(urb, GFP_ATOMIC); - if (status != 0) { + if (status) { dev_dbg(&priv->usb->dev, "Submit Rx URB failed %d\n", status); return STATUS_FAILURE; } @@ -269,15 +266,13 @@ int vnt_tx_context(struct vnt_private *priv, struct vnt_usb_send_context *context) { int status; - struct urb *urb; + struct urb *urb = context->urb; if (test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags)) { context->in_use = false; return STATUS_RESOURCES; } - urb = context->urb; - usb_fill_bulk_urb(urb, priv->usb, usb_sndbulkpipe(priv->usb, 3), @@ -287,7 +282,7 @@ int vnt_tx_context(struct vnt_private *priv, context); status = usb_submit_urb(urb, GFP_ATOMIC); - if (status != 0) { + if (status) { dev_dbg(&priv->usb->dev, "Submit Tx URB failed %d\n", status); context->in_use = false; |