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 | 38e8c910ff7a1aafe2923f085df0f74a60f9de3c (patch) | |
tree | 2bd5d27e859e3d43e478fc89a0b0a4b51ee23f54 /drivers/usb | |
parent | 52171b480865985c060a58fa3cbcd31ba6e13f75 (diff) |
USB: serial: visor: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/visor.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 81ae76f15bf0..acd0eae3b146 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -485,16 +485,17 @@ static void visor_write_bulk_callback (struct urb *urb) | |||
485 | { | 485 | { |
486 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 486 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
487 | struct visor_private *priv = usb_get_serial_port_data(port); | 487 | struct visor_private *priv = usb_get_serial_port_data(port); |
488 | int status = urb->status; | ||
488 | unsigned long flags; | 489 | unsigned long flags; |
489 | 490 | ||
490 | /* free up the transfer buffer, as usb_free_urb() does not do this */ | 491 | /* free up the transfer buffer, as usb_free_urb() does not do this */ |
491 | kfree (urb->transfer_buffer); | 492 | kfree (urb->transfer_buffer); |
492 | 493 | ||
493 | dbg("%s - port %d", __FUNCTION__, port->number); | 494 | dbg("%s - port %d", __FUNCTION__, port->number); |
494 | 495 | ||
495 | if (urb->status) | 496 | if (status) |
496 | dbg("%s - nonzero write bulk status received: %d", | 497 | dbg("%s - nonzero write bulk status received: %d", |
497 | __FUNCTION__, urb->status); | 498 | __FUNCTION__, status); |
498 | 499 | ||
499 | spin_lock_irqsave(&priv->lock, flags); | 500 | spin_lock_irqsave(&priv->lock, flags); |
500 | --priv->outstanding_urbs; | 501 | --priv->outstanding_urbs; |
@@ -509,14 +510,16 @@ static void visor_read_bulk_callback (struct urb *urb) | |||
509 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 510 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
510 | struct visor_private *priv = usb_get_serial_port_data(port); | 511 | struct visor_private *priv = usb_get_serial_port_data(port); |
511 | unsigned char *data = urb->transfer_buffer; | 512 | unsigned char *data = urb->transfer_buffer; |
513 | int status = urb->status; | ||
512 | struct tty_struct *tty; | 514 | struct tty_struct *tty; |
513 | int result; | 515 | int result; |
514 | int available_room; | 516 | int available_room; |
515 | 517 | ||
516 | dbg("%s - port %d", __FUNCTION__, port->number); | 518 | dbg("%s - port %d", __FUNCTION__, port->number); |
517 | 519 | ||
518 | if (urb->status) { | 520 | if (status) { |
519 | dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status); | 521 | dbg("%s - nonzero read bulk status received: %d", |
522 | __FUNCTION__, status); | ||
520 | return; | 523 | return; |
521 | } | 524 | } |
522 | 525 | ||
@@ -556,9 +559,10 @@ static void visor_read_bulk_callback (struct urb *urb) | |||
556 | static void visor_read_int_callback (struct urb *urb) | 559 | static void visor_read_int_callback (struct urb *urb) |
557 | { | 560 | { |
558 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 561 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; |
562 | int status = urb->status; | ||
559 | int result; | 563 | int result; |
560 | 564 | ||
561 | switch (urb->status) { | 565 | switch (status) { |
562 | case 0: | 566 | case 0: |
563 | /* success */ | 567 | /* success */ |
564 | break; | 568 | break; |
@@ -567,11 +571,11 @@ static void visor_read_int_callback (struct urb *urb) | |||
567 | case -ESHUTDOWN: | 571 | case -ESHUTDOWN: |
568 | /* this urb is terminated, clean up */ | 572 | /* this urb is terminated, clean up */ |
569 | dbg("%s - urb shutting down with status: %d", | 573 | dbg("%s - urb shutting down with status: %d", |
570 | __FUNCTION__, urb->status); | 574 | __FUNCTION__, status); |
571 | return; | 575 | return; |
572 | default: | 576 | default: |
573 | dbg("%s - nonzero urb status received: %d", | 577 | dbg("%s - nonzero urb status received: %d", |
574 | __FUNCTION__, urb->status); | 578 | __FUNCTION__, status); |
575 | goto exit; | 579 | goto exit; |
576 | } | 580 | } |
577 | 581 | ||