USB: class: cdc-acm: 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: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2007-07-18 10:58:02 -07:00
parent 33fea2b2f5
commit 185d40587d

View file

@ -257,9 +257,10 @@ static void acm_ctrl_irq(struct urb *urb)
struct usb_cdc_notification *dr = urb->transfer_buffer; struct usb_cdc_notification *dr = urb->transfer_buffer;
unsigned char *data; unsigned char *data;
int newctrl; int newctrl;
int status; int retval;
int status = urb->status;
switch (urb->status) { switch (status) {
case 0: case 0:
/* success */ /* success */
break; break;
@ -267,10 +268,10 @@ static void acm_ctrl_irq(struct urb *urb)
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
/* this urb is terminated, clean up */ /* 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; return;
default: default:
dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); dbg("%s - nonzero urb status received: %d", __FUNCTION__, status);
goto exit; goto exit;
} }
@ -311,10 +312,10 @@ static void acm_ctrl_irq(struct urb *urb)
break; break;
} }
exit: exit:
status = usb_submit_urb (urb, GFP_ATOMIC); retval = usb_submit_urb (urb, GFP_ATOMIC);
if (status) if (retval)
err ("%s - usb_submit_urb failed with result %d", err ("%s - usb_submit_urb failed with result %d",
__FUNCTION__, status); __FUNCTION__, retval);
} }
/* data interface returns incoming bytes, or we got unthrottled */ /* data interface returns incoming bytes, or we got unthrottled */
@ -324,7 +325,8 @@ static void acm_read_bulk(struct urb *urb)
struct acm_ru *rcv = urb->context; struct acm_ru *rcv = urb->context;
struct acm *acm = rcv->instance; struct acm *acm = rcv->instance;
int status = urb->status; 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)) if (!ACM_READY(acm))
return; return;