diff options
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index e06a41bd0f3b..0222d92842b8 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; |
@@ -716,14 +712,15 @@ int usb_serial_probe(struct usb_interface *interface, | |||
716 | if (((le16_to_cpu(dev->descriptor.idVendor) == PL2303_VENDOR_ID) && | 712 | if (((le16_to_cpu(dev->descriptor.idVendor) == PL2303_VENDOR_ID) && |
717 | (le16_to_cpu(dev->descriptor.idProduct) == PL2303_PRODUCT_ID)) || | 713 | (le16_to_cpu(dev->descriptor.idProduct) == PL2303_PRODUCT_ID)) || |
718 | ((le16_to_cpu(dev->descriptor.idVendor) == ATEN_VENDOR_ID) && | 714 | ((le16_to_cpu(dev->descriptor.idVendor) == ATEN_VENDOR_ID) && |
719 | (le16_to_cpu(dev->descriptor.idProduct) == ATEN_PRODUCT_ID))) { | 715 | (le16_to_cpu(dev->descriptor.idProduct) == ATEN_PRODUCT_ID)) || |
716 | ((le16_to_cpu(dev->descriptor.idVendor) == ALCOR_VENDOR_ID) && | ||
717 | (le16_to_cpu(dev->descriptor.idProduct) == ALCOR_PRODUCT_ID))) { | ||
720 | if (interface != dev->actconfig->interface[0]) { | 718 | if (interface != dev->actconfig->interface[0]) { |
721 | /* check out the endpoints of the other interface*/ | 719 | /* check out the endpoints of the other interface*/ |
722 | iface_desc = dev->actconfig->interface[0]->cur_altsetting; | 720 | iface_desc = dev->actconfig->interface[0]->cur_altsetting; |
723 | for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { | 721 | for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) { |
724 | endpoint = &iface_desc->endpoint[i].desc; | 722 | endpoint = &iface_desc->endpoint[i].desc; |
725 | if ((endpoint->bEndpointAddress & 0x80) && | 723 | if (usb_endpoint_is_int_in(endpoint)) { |
726 | ((endpoint->bmAttributes & 3) == 0x03)) { | ||
727 | /* we found a interrupt in endpoint */ | 724 | /* we found a interrupt in endpoint */ |
728 | dbg("found interrupt in for Prolific device on separate interface"); | 725 | dbg("found interrupt in for Prolific device on separate interface"); |
729 | interrupt_in_endpoint[num_interrupt_in] = endpoint; | 726 | interrupt_in_endpoint[num_interrupt_in] = endpoint; |
@@ -937,7 +934,10 @@ int usb_serial_probe(struct usb_interface *interface, | |||
937 | 934 | ||
938 | snprintf (&port->dev.bus_id[0], sizeof(port->dev.bus_id), "ttyUSB%d", port->number); | 935 | snprintf (&port->dev.bus_id[0], sizeof(port->dev.bus_id), "ttyUSB%d", port->number); |
939 | dbg ("%s - registering %s", __FUNCTION__, port->dev.bus_id); | 936 | dbg ("%s - registering %s", __FUNCTION__, port->dev.bus_id); |
940 | device_register (&port->dev); | 937 | retval = device_register(&port->dev); |
938 | if (retval) | ||
939 | dev_err(&port->dev, "Error registering port device, " | ||
940 | "continuing\n"); | ||
941 | } | 941 | } |
942 | 942 | ||
943 | usb_serial_console_init (debug, minor); | 943 | usb_serial_console_init (debug, minor); |