aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/sierra.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-06-15 18:44:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:34:36 -0400
commit17dd2215adee8c988b88308671cc20a69839a850 (patch)
tree4fbcd2fb3edea39934d378f14c3327fc138e4d55 /drivers/usb/serial/sierra.c
parent3a75ab943688d765cdb60b33f3f9db72c752c521 (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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index ac1829c6e8f0..6ee0b89a56de 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)
262 struct usb_serial_port *port; 262 struct usb_serial_port *port;
263 struct tty_struct *tty; 263 struct tty_struct *tty;
264 unsigned char *data = urb->transfer_buffer; 264 unsigned char *data = urb->transfer_buffer;
265 int status = urb->status;
265 266
266 dbg("%s: %p", __FUNCTION__, urb); 267 dbg("%s: %p", __FUNCTION__, urb);
267 268
268 endpoint = usb_pipeendpoint(urb->pipe); 269 endpoint = usb_pipeendpoint(urb->pipe);
269 port = (struct usb_serial_port *) urb->context; 270 port = (struct usb_serial_port *) urb->context;
270 271
271 if (urb->status) { 272 if (status) {
272 dbg("%s: nonzero status: %d on endpoint %02x.", 273 dbg("%s: nonzero status: %d on endpoint %02x.",
273 __FUNCTION__, urb->status, endpoint); 274 __FUNCTION__, status, endpoint);
274 } else { 275 } else {
275 tty = port->tty; 276 tty = port->tty;
276 if (urb->actual_length) { 277 if (urb->actual_length) {
@@ -282,7 +283,7 @@ static void sierra_indat_callback(struct urb *urb)
282 } 283 }
283 284
284 /* Resubmit urb so we continue receiving */ 285 /* Resubmit urb so we continue receiving */
285 if (port->open_count && urb->status != -ESHUTDOWN) { 286 if (port->open_count && status != -ESHUTDOWN) {
286 err = usb_submit_urb(urb, GFP_ATOMIC); 287 err = usb_submit_urb(urb, GFP_ATOMIC);
287 if (err) 288 if (err)
288 printk(KERN_ERR "%s: resubmit read urb failed. " 289 printk(KERN_ERR "%s: resubmit read urb failed. "
@@ -306,6 +307,7 @@ static void sierra_outdat_callback(struct urb *urb)
306static void sierra_instat_callback(struct urb *urb) 307static void sierra_instat_callback(struct urb *urb)
307{ 308{
308 int err; 309 int err;
310 int status = urb->status;
309 struct usb_serial_port *port = (struct usb_serial_port *) urb->context; 311 struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
310 struct sierra_port_private *portdata = usb_get_serial_port_data(port); 312 struct sierra_port_private *portdata = usb_get_serial_port_data(port);
311 struct usb_serial *serial = port->serial; 313 struct usb_serial *serial = port->serial;
@@ -313,7 +315,7 @@ static void sierra_instat_callback(struct urb *urb)
313 dbg("%s", __FUNCTION__); 315 dbg("%s", __FUNCTION__);
314 dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata); 316 dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
315 317
316 if (urb->status == 0) { 318 if (status == 0) {
317 struct usb_ctrlrequest *req_pkt = 319 struct usb_ctrlrequest *req_pkt =
318 (struct usb_ctrlrequest *)urb->transfer_buffer; 320 (struct usb_ctrlrequest *)urb->transfer_buffer;
319 321
@@ -344,10 +346,10 @@ static void sierra_instat_callback(struct urb *urb)
344 req_pkt->bRequestType,req_pkt->bRequest); 346 req_pkt->bRequestType,req_pkt->bRequest);
345 } 347 }
346 } else 348 } else
347 dbg("%s: error %d", __FUNCTION__, urb->status); 349 dbg("%s: error %d", __FUNCTION__, status);
348 350
349 /* Resubmit urb so we continue receiving IRQ data */ 351 /* Resubmit urb so we continue receiving IRQ data */
350 if (urb->status != -ESHUTDOWN) { 352 if (status != -ESHUTDOWN) {
351 urb->dev = serial->dev; 353 urb->dev = serial->dev;
352 err = usb_submit_urb(urb, GFP_ATOMIC); 354 err = usb_submit_urb(urb, GFP_ATOMIC);
353 if (err) 355 if (err)