diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-06-15 18:44:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:34:36 -0400 |
commit | d6977b51d5faa8649bbab0e53455e8421d425ce1 (patch) | |
tree | 149213ee370802d89b1dea79f47eff8d3056961d | |
parent | fdc2deb3892e802e916d1df7b1587aa0dbf3b271 (diff) |
USB: serial: option: 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: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/option.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index b37d65fc8752..84c12b5f1271 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -416,15 +416,16 @@ static void option_indat_callback(struct urb *urb) | |||
416 | struct usb_serial_port *port; | 416 | struct usb_serial_port *port; |
417 | struct tty_struct *tty; | 417 | struct tty_struct *tty; |
418 | unsigned char *data = urb->transfer_buffer; | 418 | unsigned char *data = urb->transfer_buffer; |
419 | int status = urb->status; | ||
419 | 420 | ||
420 | dbg("%s: %p", __FUNCTION__, urb); | 421 | dbg("%s: %p", __FUNCTION__, urb); |
421 | 422 | ||
422 | endpoint = usb_pipeendpoint(urb->pipe); | 423 | endpoint = usb_pipeendpoint(urb->pipe); |
423 | port = (struct usb_serial_port *) urb->context; | 424 | port = (struct usb_serial_port *) urb->context; |
424 | 425 | ||
425 | if (urb->status) { | 426 | if (status) { |
426 | dbg("%s: nonzero status: %d on endpoint %02x.", | 427 | dbg("%s: nonzero status: %d on endpoint %02x.", |
427 | __FUNCTION__, urb->status, endpoint); | 428 | __FUNCTION__, status, endpoint); |
428 | } else { | 429 | } else { |
429 | tty = port->tty; | 430 | tty = port->tty; |
430 | if (urb->actual_length) { | 431 | if (urb->actual_length) { |
@@ -436,7 +437,7 @@ static void option_indat_callback(struct urb *urb) | |||
436 | } | 437 | } |
437 | 438 | ||
438 | /* Resubmit urb so we continue receiving */ | 439 | /* Resubmit urb so we continue receiving */ |
439 | if (port->open_count && urb->status != -ESHUTDOWN) { | 440 | if (port->open_count && status != -ESHUTDOWN) { |
440 | err = usb_submit_urb(urb, GFP_ATOMIC); | 441 | err = usb_submit_urb(urb, GFP_ATOMIC); |
441 | if (err) | 442 | if (err) |
442 | printk(KERN_ERR "%s: resubmit read urb failed. " | 443 | printk(KERN_ERR "%s: resubmit read urb failed. " |
@@ -471,6 +472,7 @@ static void option_outdat_callback(struct urb *urb) | |||
471 | static void option_instat_callback(struct urb *urb) | 472 | static void option_instat_callback(struct urb *urb) |
472 | { | 473 | { |
473 | int err; | 474 | int err; |
475 | int status = urb->status; | ||
474 | struct usb_serial_port *port = (struct usb_serial_port *) urb->context; | 476 | struct usb_serial_port *port = (struct usb_serial_port *) urb->context; |
475 | struct option_port_private *portdata = usb_get_serial_port_data(port); | 477 | struct option_port_private *portdata = usb_get_serial_port_data(port); |
476 | struct usb_serial *serial = port->serial; | 478 | struct usb_serial *serial = port->serial; |
@@ -478,7 +480,7 @@ static void option_instat_callback(struct urb *urb) | |||
478 | dbg("%s", __FUNCTION__); | 480 | dbg("%s", __FUNCTION__); |
479 | dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata); | 481 | dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata); |
480 | 482 | ||
481 | if (urb->status == 0) { | 483 | if (status == 0) { |
482 | struct usb_ctrlrequest *req_pkt = | 484 | struct usb_ctrlrequest *req_pkt = |
483 | (struct usb_ctrlrequest *)urb->transfer_buffer; | 485 | (struct usb_ctrlrequest *)urb->transfer_buffer; |
484 | 486 | ||
@@ -509,10 +511,10 @@ static void option_instat_callback(struct urb *urb) | |||
509 | req_pkt->bRequestType,req_pkt->bRequest); | 511 | req_pkt->bRequestType,req_pkt->bRequest); |
510 | } | 512 | } |
511 | } else | 513 | } else |
512 | dbg("%s: error %d", __FUNCTION__, urb->status); | 514 | dbg("%s: error %d", __FUNCTION__, status); |
513 | 515 | ||
514 | /* Resubmit urb so we continue receiving IRQ data */ | 516 | /* Resubmit urb so we continue receiving IRQ data */ |
515 | if (urb->status != -ESHUTDOWN) { | 517 | if (status != -ESHUTDOWN) { |
516 | urb->dev = serial->dev; | 518 | urb->dev = serial->dev; |
517 | err = usb_submit_urb(urb, GFP_ATOMIC); | 519 | err = usb_submit_urb(urb, GFP_ATOMIC); |
518 | if (err) | 520 | if (err) |