Skip to content

Commit

Permalink
ub: Bind to first endpoint, not to last
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Pete Zaitcev authored and gregkh committed Apr 27, 2007
1 parent c4cabd2 commit 643616e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2132,10 +2132,13 @@ static int ub_get_pipes(struct ub_dev *sc, struct usb_device *dev,
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;
}
}
}

Expand Down

0 comments on commit 643616e

Please sign in to comment.