aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@sfr.fr>2011-03-21 15:58:56 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 15:38:26 -0400
commit7106225a9e7d123ff87a6848972b6d28c8903940 (patch)
tree5372803a5702a4f92bd5f2774ffccc9fff2d4326 /drivers/media/video/gspca
parent8e3c08bb41145bd8507397f63937759500c12a04 (diff)
[media] gspca - main: Add endpoint direction test in alt_xfer
This patch fixes a bug in gspca, more precisely in alt_xfer(). This function looks for an input transfer endpoint in an alternate setting. By default it returns the first endpoint corresponding to the transfer type indicated in parameter. But with some USB devices, the first endpoint corresponding to the transfer type is not always an INPUT endpoint but an OUTPUT one. This patch adds the endpoint direction test to be sure to return an INPUT endpoint Signed-off-by: Patrice CHOTARD <patricechotard@free.fr> Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/gspca.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 62881740a0bd..9c6a643caf01 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -630,7 +630,8 @@ static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt,
630 ep = &alt->endpoint[i]; 630 ep = &alt->endpoint[i];
631 attr = ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; 631 attr = ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
632 if (attr == xfer 632 if (attr == xfer
633 && ep->desc.wMaxPacketSize != 0) 633 && ep->desc.wMaxPacketSize != 0
634 && usb_endpoint_dir_in(&ep->desc))
634 return ep; 635 return ep;
635 } 636 }
636 return NULL; 637 return NULL;