Staging: comedi: Use USB_ENDPOINT_DIR_MASK instead of USB_DIR_IN
PATCH 1/1 Staging: comedi: Use USB_ENDPOINT_DIR_MASK instead of USB_DIR_IN
USB_ENDPOINT_DIR_MASK and USB_DIR_IN have the same value, but USB_ENDPOINT_DIR_MASK is more correct for use as a mask.
Signed-off-by Sandhya Bankar <[email protected]>
--- drivers/staging/comedi/drivers/dt9812.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/comedi/drivers/dt9812.c +1 -1
@@ -676,7 +676,7 @@ static int dt9812_find_endpoints(struct comedi_device *dev) dir =USB_DIR_IN ;break ; } -if ((ep->bEndpointAddress &USB_DIR_IN ) != dir) { +if ((ep->bEndpointAddress &USB_ENDPOINT_DIR_MASK ) != dir) {dev_err (dev->class_dev,"Endpoint has wrong direction\n" );return -ENODEV ;
Signature · 1 line
1.7.1
Greg KH
maintainerQuoted 13 lines · Sandhya Bankar
USB_ENDPOINT_DIR_MASKandUSB_DIR_INhave the same value, butUSB_ENDPOINT_DIR_MASKis more correct for use as a mask.Signed-off-by Sandhya Bankar <[email protected]>--- drivers/staging/comedi/drivers/dt9812.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/staging/comedi/drivers/dt9812.c +0
-0
drivers/staging/comedi/drivers/dt9812.c static int dt9812_find_endpoints(struct comedi_device *dev) · line 679
Quoted 5 lines
drivers/staging/comedi/drivers/dt9812.c +1
-1@@ -676,7 +676,7 @@ static int dt9812_find_endpoints(struct comedi_device *dev) dir =USB_DIR_IN ;break ; } -if ((ep->bEndpointAddress &USB_DIR_IN ) != dir) { +if ((ep->bEndpointAddress &USB_ENDPOINT_DIR_MASK ) != dir) {
This is messy, and I don't think that this code will ever "normally" be triggered. Can you rewrite this loop to properly check for the endpoint type using the functions you used last time, and not trigger off of the endpoint number? That would be a much cleaner and saner fix for this.
thanks,
greg k-h