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>
This commit is contained in:
parent
60ca126c95
commit
4fa1bbf5cf
|
@ -677,32 +677,28 @@ int usb_serial_probe(struct usb_interface *interface,
|
||||||
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
||||||
endpoint = &iface_desc->endpoint[i].desc;
|
endpoint = &iface_desc->endpoint[i].desc;
|
||||||
|
|
||||||
if ((endpoint->bEndpointAddress & 0x80) &&
|
if (usb_endpoint_is_bulk_in(endpoint)) {
|
||||||
((endpoint->bmAttributes & 3) == 0x02)) {
|
|
||||||
/* we found a bulk in endpoint */
|
/* we found a bulk in endpoint */
|
||||||
dbg("found bulk in on endpoint %d", i);
|
dbg("found bulk in on endpoint %d", i);
|
||||||
bulk_in_endpoint[num_bulk_in] = endpoint;
|
bulk_in_endpoint[num_bulk_in] = endpoint;
|
||||||
++num_bulk_in;
|
++num_bulk_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((endpoint->bEndpointAddress & 0x80) == 0x00) &&
|
if (usb_endpoint_is_bulk_out(endpoint)) {
|
||||||
((endpoint->bmAttributes & 3) == 0x02)) {
|
|
||||||
/* we found a bulk out endpoint */
|
/* we found a bulk out endpoint */
|
||||||
dbg("found bulk out on endpoint %d", i);
|
dbg("found bulk out on endpoint %d", i);
|
||||||
bulk_out_endpoint[num_bulk_out] = endpoint;
|
bulk_out_endpoint[num_bulk_out] = endpoint;
|
||||||
++num_bulk_out;
|
++num_bulk_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((endpoint->bEndpointAddress & 0x80) &&
|
if (usb_endpoint_is_int_in(endpoint)) {
|
||||||
((endpoint->bmAttributes & 3) == 0x03)) {
|
|
||||||
/* we found a interrupt in endpoint */
|
/* we found a interrupt in endpoint */
|
||||||
dbg("found interrupt in on endpoint %d", i);
|
dbg("found interrupt in on endpoint %d", i);
|
||||||
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
||||||
++num_interrupt_in;
|
++num_interrupt_in;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((endpoint->bEndpointAddress & 0x80) == 0x00) &&
|
if (usb_endpoint_is_int_out(endpoint)) {
|
||||||
((endpoint->bmAttributes & 3) == 0x03)) {
|
|
||||||
/* we found an interrupt out endpoint */
|
/* we found an interrupt out endpoint */
|
||||||
dbg("found interrupt out on endpoint %d", i);
|
dbg("found interrupt out on endpoint %d", i);
|
||||||
interrupt_out_endpoint[num_interrupt_out] = endpoint;
|
interrupt_out_endpoint[num_interrupt_out] = endpoint;
|
||||||
|
@ -722,8 +718,7 @@ int usb_serial_probe(struct usb_interface *interface,
|
||||||
iface_desc = dev->actconfig->interface[0]->cur_altsetting;
|
iface_desc = dev->actconfig->interface[0]->cur_altsetting;
|
||||||
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
|
||||||
endpoint = &iface_desc->endpoint[i].desc;
|
endpoint = &iface_desc->endpoint[i].desc;
|
||||||
if ((endpoint->bEndpointAddress & 0x80) &&
|
if (usb_endpoint_is_int_in(endpoint)) {
|
||||||
((endpoint->bmAttributes & 3) == 0x03)) {
|
|
||||||
/* we found a interrupt in endpoint */
|
/* we found a interrupt in endpoint */
|
||||||
dbg("found interrupt in for Prolific device on separate interface");
|
dbg("found interrupt in for Prolific device on separate interface");
|
||||||
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
interrupt_in_endpoint[num_interrupt_in] = endpoint;
|
||||||
|
|
Loading…
Reference in New Issue