tree 47be6973ba2f07151b742f49f1c859ed8a6bd901
parent 3eb0c5f4b539873ca88f8597db6a49e83ddfd7e2
author Conger, Chris A <[EMAIL PROTECTED]> Sat, 30 Jul 2005 02:18:23 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sat, 30 Jul 2005 03:12:54 -0700

[PATCH] USB: fix Bug in usb-skeleton.c

Compare endpoint address to USB_ENDPOINT_DIR_MASK to determine endpoint
direction...

From: "Conger, Chris A." <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/usb/usb-skeleton.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -257,7 +257,8 @@ static int skel_probe(struct usb_interfa
                endpoint = &iface_desc->endpoint[i].desc;
 
                if (!dev->bulk_in_endpointAddr &&
-                   (endpoint->bEndpointAddress & USB_DIR_IN) &&
+                   ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK)
+                                       == USB_DIR_IN) &&
                    ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
                                        == USB_ENDPOINT_XFER_BULK)) {
                        /* we found a bulk in endpoint */
@@ -272,7 +273,8 @@ static int skel_probe(struct usb_interfa
                }
 
                if (!dev->bulk_out_endpointAddr &&
-                   !(endpoint->bEndpointAddress & USB_DIR_OUT) &&
+                   ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK)
+                                       == USB_DIR_OUT) &&
                    ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
                                        == USB_ENDPOINT_XFER_BULK)) {
                        /* we found a bulk out endpoint */
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to