diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-06-15 15:44:13 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 16:34:36 -0700 |
commit | 17dd2215adee8c988b88308671cc20a69839a850 (patch) | |
tree | 4fbcd2fb3edea39934d378f14c3327fc138e4d55 /drivers/usb/serial/sierra.c | |
parent | 3a75ab943688d765cdb60b33f3f9db72c752c521 (diff) |
USB: serial: sierra: 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.
Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Kevin Lloyd <linux@sierrawireless.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/sierra.c')
-rw-r--r-- | drivers/usb/serial/sierra.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index ac1829c6e8f..6ee0b89a56d 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -262,15 +262,16 @@ static void sierra_indat_callback(struct urb *urb) struct usb_serial_port *port; struct tty_struct *tty; unsigned char *data = urb->transfer_buffer; + int status = urb->status; dbg("%s: %p", __FUNCTION__, urb); endpoint = usb_pipeendpoint(urb->pipe); port = (struct usb_serial_port *) urb->context; - if (urb->status) { + if (status) { dbg("%s: nonzero status: %d on endpoint %02x.", - __FUNCTION__, urb->status, endpoint); + __FUNCTION__, status, endpoint); } else { tty = port->tty; if (urb->actual_length) { @@ -282,7 +283,7 @@ static void sierra_indat_callback(struct urb *urb) } /* Resubmit urb so we continue receiving */ - if (port->open_count && urb->status != -ESHUTDOWN) { + if (port->open_count && status != -ESHUTDOWN) { err = usb_submit_urb(urb, GFP_ATOMIC); if (err) printk(KERN_ERR "%s: resubmit read urb failed. " @@ -306,6 +307,7 @@ static void sierra_outdat_callback(struct urb *urb) static void sierra_instat_callback(struct urb *urb) { int err; + int status = urb->status; struct usb_serial_port *port = (struct usb_serial_port *) urb->context; struct sierra_port_private *portdata = usb_get_serial_port_data(port); struct usb_serial *serial = port->serial; @@ -313,7 +315,7 @@ static void sierra_instat_callback(struct urb *urb) dbg("%s", __FUNCTION__); dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata); - if (urb->status == 0) { + if (status == 0) { struct usb_ctrlrequest *req_pkt = (struct usb_ctrlrequest *)urb->transfer_buffer; @@ -344,10 +346,10 @@ static void sierra_instat_callback(struct urb *urb) req_pkt->bRequestType,req_pkt->bRequest); } } else - dbg("%s: error %d", __FUNCTION__, urb->status); + dbg("%s: error %d", __FUNCTION__, status); /* Resubmit urb so we continue receiving IRQ data */ - if (urb->status != -ESHUTDOWN) { + if (status != -ESHUTDOWN) { urb->dev = serial->dev; err = usb_submit_urb(urb, GFP_ATOMIC); if (err) |