blob: 740d22d491d4a8c38f103104cf47b95b6d883941 [file] [log] [blame]
From zaitcev@redhat.com Thu Mar 8 19:56:33 2007
From: Pete Zaitcev <zaitcev@redhat.com>
Date: Thu, 8 Mar 2007 19:56:23 -0800
Subject: ub: Bind to first endpoint, not to last
To: greg@kroah.com
Message-ID: <20070308195623.9a486929.zaitcev@redhat.com>
The usb-storage switched to binding to first endpoint recently. Apparently,
there are devices out there with extra endpoints. It is perfectly legal.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/block/ub.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -2132,10 +2132,13 @@ static int ub_get_pipes(struct ub_dev *s
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK) {
/* BULK in or out? */
- if (ep->bEndpointAddress & USB_DIR_IN)
- ep_in = ep;
- else
- ep_out = ep;
+ if (ep->bEndpointAddress & USB_DIR_IN) {
+ if (ep_in == NULL)
+ ep_in = ep;
+ } else {
+ if (ep_out == NULL)
+ ep_out = ep;
+ }
}
}