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:35 -0400 |
commit | 0643c72435bcd36980314de825773989d4dca97f (patch) | |
tree | ee2009882b969c7ddfbe7cd5853b4acbb337a2e7 /drivers/usb/serial/mos7840.c | |
parent | 81105984848481d8876e454e3c503dbd0e8e4dce (diff) |
USB: serial: mos7840: 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: Paul Schroeder <pschroeder@uplogix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/mos7840.c')
-rw-r--r-- | drivers/usb/serial/mos7840.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 36620c651079..a6678826452f 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -434,6 +434,7 @@ static void mos7840_control_callback(struct urb *urb) | |||
434 | struct moschip_port *mos7840_port; | 434 | struct moschip_port *mos7840_port; |
435 | __u8 regval = 0x0; | 435 | __u8 regval = 0x0; |
436 | int result = 0; | 436 | int result = 0; |
437 | int status = urb->status; | ||
437 | 438 | ||
438 | if (!urb) { | 439 | if (!urb) { |
439 | dbg("%s", "Invalid Pointer !!!!:\n"); | 440 | dbg("%s", "Invalid Pointer !!!!:\n"); |
@@ -442,7 +443,7 @@ static void mos7840_control_callback(struct urb *urb) | |||
442 | 443 | ||
443 | mos7840_port = (struct moschip_port *)urb->context; | 444 | mos7840_port = (struct moschip_port *)urb->context; |
444 | 445 | ||
445 | switch (urb->status) { | 446 | switch (status) { |
446 | case 0: | 447 | case 0: |
447 | /* success */ | 448 | /* success */ |
448 | break; | 449 | break; |
@@ -451,11 +452,11 @@ static void mos7840_control_callback(struct urb *urb) | |||
451 | case -ESHUTDOWN: | 452 | case -ESHUTDOWN: |
452 | /* this urb is terminated, clean up */ | 453 | /* this urb is terminated, clean up */ |
453 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, | 454 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, |
454 | urb->status); | 455 | status); |
455 | return; | 456 | return; |
456 | default: | 457 | default: |
457 | dbg("%s - nonzero urb status received: %d", __FUNCTION__, | 458 | dbg("%s - nonzero urb status received: %d", __FUNCTION__, |
458 | urb->status); | 459 | status); |
459 | goto exit; | 460 | goto exit; |
460 | } | 461 | } |
461 | 462 | ||
@@ -521,6 +522,7 @@ static void mos7840_interrupt_callback(struct urb *urb) | |||
521 | __u8 sp[5], st; | 522 | __u8 sp[5], st; |
522 | int i, rv = 0; | 523 | int i, rv = 0; |
523 | __u16 wval, wreg = 0; | 524 | __u16 wval, wreg = 0; |
525 | int status = urb->status; | ||
524 | 526 | ||
525 | dbg("%s", " : Entering\n"); | 527 | dbg("%s", " : Entering\n"); |
526 | if (!urb) { | 528 | if (!urb) { |
@@ -528,7 +530,7 @@ static void mos7840_interrupt_callback(struct urb *urb) | |||
528 | return; | 530 | return; |
529 | } | 531 | } |
530 | 532 | ||
531 | switch (urb->status) { | 533 | switch (status) { |
532 | case 0: | 534 | case 0: |
533 | /* success */ | 535 | /* success */ |
534 | break; | 536 | break; |
@@ -537,11 +539,11 @@ static void mos7840_interrupt_callback(struct urb *urb) | |||
537 | case -ESHUTDOWN: | 539 | case -ESHUTDOWN: |
538 | /* this urb is terminated, clean up */ | 540 | /* this urb is terminated, clean up */ |
539 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, | 541 | dbg("%s - urb shutting down with status: %d", __FUNCTION__, |
540 | urb->status); | 542 | status); |
541 | return; | 543 | return; |
542 | default: | 544 | default: |
543 | dbg("%s - nonzero urb status received: %d", __FUNCTION__, | 545 | dbg("%s - nonzero urb status received: %d", __FUNCTION__, |
544 | urb->status); | 546 | status); |
545 | goto exit; | 547 | goto exit; |
546 | } | 548 | } |
547 | 549 | ||
@@ -666,20 +668,21 @@ static struct usb_serial *mos7840_get_usb_serial(struct usb_serial_port *port, | |||
666 | 668 | ||
667 | static void mos7840_bulk_in_callback(struct urb *urb) | 669 | static void mos7840_bulk_in_callback(struct urb *urb) |
668 | { | 670 | { |
669 | int status; | 671 | int retval; |
670 | unsigned char *data; | 672 | unsigned char *data; |
671 | struct usb_serial *serial; | 673 | struct usb_serial *serial; |
672 | struct usb_serial_port *port; | 674 | struct usb_serial_port *port; |
673 | struct moschip_port *mos7840_port; | 675 | struct moschip_port *mos7840_port; |
674 | struct tty_struct *tty; | 676 | struct tty_struct *tty; |
677 | int status = urb->status; | ||
675 | 678 | ||
676 | if (!urb) { | 679 | if (!urb) { |
677 | dbg("%s", "Invalid Pointer !!!!:\n"); | 680 | dbg("%s", "Invalid Pointer !!!!:\n"); |
678 | return; | 681 | return; |
679 | } | 682 | } |
680 | 683 | ||
681 | if (urb->status) { | 684 | if (status) { |
682 | dbg("nonzero read bulk status received: %d", urb->status); | 685 | dbg("nonzero read bulk status received: %d", status); |
683 | return; | 686 | return; |
684 | } | 687 | } |
685 | 688 | ||
@@ -729,11 +732,11 @@ static void mos7840_bulk_in_callback(struct urb *urb) | |||
729 | 732 | ||
730 | mos7840_port->read_urb->dev = serial->dev; | 733 | mos7840_port->read_urb->dev = serial->dev; |
731 | 734 | ||
732 | status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); | 735 | retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); |
733 | 736 | ||
734 | if (status) { | 737 | if (retval) { |
735 | dbg(" usb_submit_urb(read bulk) failed, status = %d", | 738 | dbg(" usb_submit_urb(read bulk) failed, retval = %d", |
736 | status); | 739 | retval); |
737 | } | 740 | } |
738 | } | 741 | } |
739 | 742 | ||
@@ -747,6 +750,7 @@ static void mos7840_bulk_out_data_callback(struct urb *urb) | |||
747 | { | 750 | { |
748 | struct moschip_port *mos7840_port; | 751 | struct moschip_port *mos7840_port; |
749 | struct tty_struct *tty; | 752 | struct tty_struct *tty; |
753 | int status = urb->status; | ||
750 | int i; | 754 | int i; |
751 | 755 | ||
752 | if (!urb) { | 756 | if (!urb) { |
@@ -764,8 +768,8 @@ static void mos7840_bulk_out_data_callback(struct urb *urb) | |||
764 | } | 768 | } |
765 | spin_unlock(&mos7840_port->pool_lock); | 769 | spin_unlock(&mos7840_port->pool_lock); |
766 | 770 | ||
767 | if (urb->status) { | 771 | if (status) { |
768 | dbg("nonzero write bulk status received:%d\n", urb->status); | 772 | dbg("nonzero write bulk status received:%d\n", status); |
769 | return; | 773 | return; |
770 | } | 774 | } |
771 | 775 | ||