From bbc048f8ed088c6c65085a61bd530608dbb81ade Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Mon, 22 Jan 2007 11:58:34 -0500 Subject: [PATCH] --- yaml --- r: 46693 b: refs/heads/master c: 1096f780d0b9d6bade2d42bf823e81db3e553abe h: refs/heads/master i: 46691: 264e8e38166280e38aab518f44ddbabc9016deb7 v: v3 --- [refs] | 2 +- trunk/drivers/usb/storage/usb.c | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index a3eb6466b428..5adb4ff3e700 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 629e4427aa817d5c9f11885420abf54b8f5967dc +refs/heads/master: 1096f780d0b9d6bade2d42bf823e81db3e553abe diff --git a/trunk/drivers/usb/storage/usb.c b/trunk/drivers/usb/storage/usb.c index 70644506651f..7e7ec29782f1 100644 --- a/trunk/drivers/usb/storage/usb.c +++ b/trunk/drivers/usb/storage/usb.c @@ -731,26 +731,27 @@ static int get_pipes(struct us_data *us) struct usb_endpoint_descriptor *ep_int = NULL; /* - * Find the endpoints we need. + * Find the first endpoint of each type we need. * We are expecting a minimum of 2 endpoints - in and out (bulk). - * An optional interrupt is OK (necessary for CBI protocol). + * An optional interrupt-in is OK (necessary for CBI protocol). * We will ignore any others. */ for (i = 0; i < altsetting->desc.bNumEndpoints; i++) { ep = &altsetting->endpoint[i].desc; - /* Is it a BULK endpoint? */ if (usb_endpoint_xfer_bulk(ep)) { - /* BULK in or out? */ - if (usb_endpoint_dir_in(ep)) - ep_in = ep; - else - ep_out = ep; + if (usb_endpoint_dir_in(ep)) { + if (!ep_in) + ep_in = ep; + } else { + if (!ep_out) + ep_out = ep; + } } - /* Is it an interrupt endpoint? */ - else if (usb_endpoint_xfer_int(ep)) { - ep_int = ep; + else if (usb_endpoint_is_int_in(ep)) { + if (!ep_int) + ep_int = ep; } }