aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>2006-09-27 14:58:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:53 -0400
commit4fa1bbf5cfac0e8c795e0ef7b2b939b45229ef2b (patch)
tree5ed78ad5c5375c6808a0b54e636df2ead32eb670 /drivers
parent60ca126c9589e3f4bcf81db9762dca82946cd2ba (diff)
USB: usb-serial: Use usb_endpoint_* functions.
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/usb-serial.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index e06a41bd0f3b..1f21a9d4b700 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -676,33 +676,29 @@ int usb_serial_probe(struct usb_interface *interface,
676 iface_desc = interface->cur_altsetting; 676 iface_desc = interface->cur_altsetting;
677 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { 677 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
678 endpoint = &iface_desc->endpoint[i].desc; 678 endpoint = &iface_desc->endpoint[i].desc;
679 679
680 if ((endpoint->bEndpointAddress & 0x80) && 680 if (usb_endpoint_is_bulk_in(endpoint)) {
681 ((endpoint->bmAttributes & 3) == 0x02)) {
682 /* we found a bulk in endpoint */ 681 /* we found a bulk in endpoint */
683 dbg("found bulk in on endpoint %d", i); 682 dbg("found bulk in on endpoint %d", i);
684 bulk_in_endpoint[num_bulk_in] = endpoint; 683 bulk_in_endpoint[num_bulk_in] = endpoint;
685 ++num_bulk_in; 684 ++num_bulk_in;
686 } 685 }
687 686
688 if (((endpoint->bEndpointAddress & 0x80) == 0x00) && 687 if (usb_endpoint_is_bulk_out(endpoint)) {
689 ((endpoint->bmAttributes & 3) == 0x02)) {
690 /* we found a bulk out endpoint */ 688 /* we found a bulk out endpoint */
691 dbg("found bulk out on endpoint %d", i); 689 dbg("found bulk out on endpoint %d", i);
692 bulk_out_endpoint[num_bulk_out] = endpoint; 690 bulk_out_endpoint[num_bulk_out] = endpoint;
693 ++num_bulk_out; 691 ++num_bulk_out;
694 } 692 }
695 693
696 if ((endpoint->bEndpointAddress & 0x80) && 694 if (usb_endpoint_is_int_in(endpoint)) {
697 ((endpoint->bmAttributes & 3) == 0x03)) {
698 /* we found a interrupt in endpoint */ 695 /* we found a interrupt in endpoint */
699 dbg("found interrupt in on endpoint %d", i); 696 dbg("found interrupt in on endpoint %d", i);
700 interrupt_in_endpoint[num_interrupt_in] = endpoint; 697 interrupt_in_endpoint[num_interrupt_in] = endpoint;
701 ++num_interrupt_in; 698 ++num_interrupt_in;
702 } 699 }
703 700
704 if (((endpoint->bEndpointAddress & 0x80) == 0x00) && 701 if (usb_endpoint_is_int_out(endpoint)) {
705 ((endpoint->bmAttributes & 3) == 0x03)) {
706 /* we found an interrupt out endpoint */ 702 /* we found an interrupt out endpoint */
707 dbg("found interrupt out on endpoint %d", i); 703 dbg("found interrupt out on endpoint %d", i);
708 interrupt_out_endpoint[num_interrupt_out] = endpoint; 704 interrupt_out_endpoint[num_interrupt_out] = endpoint;
@@ -722,8 +718,7 @@ int usb_serial_probe(struct usb_interface *interface,
722 iface_desc = dev->actconfig->interface[0]->cur_altsetting; 718 iface_desc = dev->actconfig->interface[0]->cur_altsetting;
723 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { 719 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
724 endpoint = &iface_desc->endpoint[i].desc; 720 endpoint = &iface_desc->endpoint[i].desc;
725 if ((endpoint->bEndpointAddress & 0x80) && 721 if (usb_endpoint_is_int_in(endpoint)) {
726 ((endpoint->bmAttributes & 3) == 0x03)) {
727 /* we found a interrupt in endpoint */ 722 /* we found a interrupt in endpoint */
728 dbg("found interrupt in for Prolific device on separate interface"); 723 dbg("found interrupt in for Prolific device on separate interface");
729 interrupt_in_endpoint[num_interrupt_in] = endpoint; 724 interrupt_in_endpoint[num_interrupt_in] = endpoint;