Skip to content

Commit

Permalink
USB: class: cdc-acm: clean up urb->status usage
Browse files Browse the repository at this point in the history
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: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2007
1 parent 33fea2b commit 185d405
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,21 @@ static void acm_ctrl_irq(struct urb *urb)
struct usb_cdc_notification *dr = urb->transfer_buffer;
unsigned char *data;
int newctrl;
int status;
int retval;
int status = urb->status;

switch (urb->status) {
switch (status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d", __FUNCTION__, urb->status);
dbg("%s - urb shutting down with status: %d", __FUNCTION__, status);
return;
default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
dbg("%s - nonzero urb status received: %d", __FUNCTION__, status);
goto exit;
}

Expand Down Expand Up @@ -311,10 +312,10 @@ static void acm_ctrl_irq(struct urb *urb)
break;
}
exit:
status = usb_submit_urb (urb, GFP_ATOMIC);
if (status)
retval = usb_submit_urb (urb, GFP_ATOMIC);
if (retval)
err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, status);
__FUNCTION__, retval);
}

/* data interface returns incoming bytes, or we got unthrottled */
Expand All @@ -324,7 +325,8 @@ static void acm_read_bulk(struct urb *urb)
struct acm_ru *rcv = urb->context;
struct acm *acm = rcv->instance;
int status = urb->status;
dbg("Entering acm_read_bulk with status %d", urb->status);

dbg("Entering acm_read_bulk with status %d", status);

if (!ACM_READY(acm))
return;
Expand Down

0 comments on commit 185d405

Please sign in to comment.