diff options
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r-- | drivers/usb/storage/usb.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 70644506651f..7e7ec29782f1 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -731,26 +731,27 @@ static int get_pipes(struct us_data *us) | |||
731 | struct usb_endpoint_descriptor *ep_int = NULL; | 731 | struct usb_endpoint_descriptor *ep_int = NULL; |
732 | 732 | ||
733 | /* | 733 | /* |
734 | * Find the endpoints we need. | 734 | * Find the first endpoint of each type we need. |
735 | * We are expecting a minimum of 2 endpoints - in and out (bulk). | 735 | * We are expecting a minimum of 2 endpoints - in and out (bulk). |
736 | * An optional interrupt is OK (necessary for CBI protocol). | 736 | * An optional interrupt-in is OK (necessary for CBI protocol). |
737 | * We will ignore any others. | 737 | * We will ignore any others. |
738 | */ | 738 | */ |
739 | for (i = 0; i < altsetting->desc.bNumEndpoints; i++) { | 739 | for (i = 0; i < altsetting->desc.bNumEndpoints; i++) { |
740 | ep = &altsetting->endpoint[i].desc; | 740 | ep = &altsetting->endpoint[i].desc; |
741 | 741 | ||
742 | /* Is it a BULK endpoint? */ | ||
743 | if (usb_endpoint_xfer_bulk(ep)) { | 742 | if (usb_endpoint_xfer_bulk(ep)) { |
744 | /* BULK in or out? */ | 743 | if (usb_endpoint_dir_in(ep)) { |
745 | if (usb_endpoint_dir_in(ep)) | 744 | if (!ep_in) |
746 | ep_in = ep; | 745 | ep_in = ep; |
747 | else | 746 | } else { |
748 | ep_out = ep; | 747 | if (!ep_out) |
748 | ep_out = ep; | ||
749 | } | ||
749 | } | 750 | } |
750 | 751 | ||
751 | /* Is it an interrupt endpoint? */ | 752 | else if (usb_endpoint_is_int_in(ep)) { |
752 | else if (usb_endpoint_xfer_int(ep)) { | 753 | if (!ep_int) |
753 | ep_int = ep; | 754 | ep_int = ep; |
754 | } | 755 | } |
755 | } | 756 | } |
756 | 757 | ||