Commit 643616e6 authored by Pete Zaitcev's avatar Pete Zaitcev Committed by Greg Kroah-Hartman

ub: Bind to first endpoint, not to last

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: default avatarPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c4cabd28
...@@ -2132,12 +2132,15 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev, ...@@ -2132,12 +2132,15 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev,
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK) { == USB_ENDPOINT_XFER_BULK) {
/* BULK in or out? */ /* BULK in or out? */
if (ep->bEndpointAddress & USB_DIR_IN) if (ep->bEndpointAddress & USB_DIR_IN) {
if (ep_in == NULL)
ep_in = ep; ep_in = ep;
else } else {
if (ep_out == NULL)
ep_out = ep; ep_out = ep;
} }
} }
}
if (ep_in == NULL || ep_out == NULL) { if (ep_in == NULL || ep_out == NULL) {
printk(KERN_NOTICE "%s: failed endpoint check\n", printk(KERN_NOTICE "%s: failed endpoint check\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment