diff options
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 9b77ebbd875d..e13833b8ed67 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c | |||
@@ -439,22 +439,16 @@ static void destroy_urbs(struct gspca_dev *gspca_dev) | |||
439 | * look for an input transfer endpoint in an alternate setting | 439 | * look for an input transfer endpoint in an alternate setting |
440 | */ | 440 | */ |
441 | static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt, | 441 | static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt, |
442 | __u8 epaddr, | ||
443 | __u8 xfer) | 442 | __u8 xfer) |
444 | { | 443 | { |
445 | struct usb_host_endpoint *ep; | 444 | struct usb_host_endpoint *ep; |
446 | int i, attr; | 445 | int i, attr; |
447 | 446 | ||
448 | epaddr |= USB_DIR_IN; | ||
449 | for (i = 0; i < alt->desc.bNumEndpoints; i++) { | 447 | for (i = 0; i < alt->desc.bNumEndpoints; i++) { |
450 | ep = &alt->endpoint[i]; | 448 | ep = &alt->endpoint[i]; |
451 | if (ep->desc.bEndpointAddress == epaddr) { | 449 | attr = ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; |
452 | attr = ep->desc.bmAttributes | 450 | if (attr == xfer) |
453 | & USB_ENDPOINT_XFERTYPE_MASK; | 451 | return ep; |
454 | if (attr == xfer) | ||
455 | return ep; | ||
456 | break; | ||
457 | } | ||
458 | } | 452 | } |
459 | return NULL; | 453 | return NULL; |
460 | } | 454 | } |
@@ -480,7 +474,6 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) | |||
480 | /* try isoc */ | 474 | /* try isoc */ |
481 | while (--i > 0) { /* alt 0 is unusable */ | 475 | while (--i > 0) { /* alt 0 is unusable */ |
482 | ep = alt_xfer(&intf->altsetting[i], | 476 | ep = alt_xfer(&intf->altsetting[i], |
483 | gspca_dev->cam.epaddr, | ||
484 | USB_ENDPOINT_XFER_ISOC); | 477 | USB_ENDPOINT_XFER_ISOC); |
485 | if (ep) | 478 | if (ep) |
486 | break; | 479 | break; |
@@ -489,7 +482,6 @@ static struct usb_host_endpoint *get_ep(struct gspca_dev *gspca_dev) | |||
489 | /* if no isoc, try bulk */ | 482 | /* if no isoc, try bulk */ |
490 | if (ep == NULL) { | 483 | if (ep == NULL) { |
491 | ep = alt_xfer(&intf->altsetting[0], | 484 | ep = alt_xfer(&intf->altsetting[0], |
492 | gspca_dev->cam.epaddr, | ||
493 | USB_ENDPOINT_XFER_BULK); | 485 | USB_ENDPOINT_XFER_BULK); |
494 | if (ep == NULL) { | 486 | if (ep == NULL) { |
495 | err("no transfer endpoint found"); | 487 | err("no transfer endpoint found"); |
@@ -618,8 +610,7 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev) | |||
618 | /* clear the bulk endpoint */ | 610 | /* clear the bulk endpoint */ |
619 | if (gspca_dev->alt == 0) /* if bulk transfer */ | 611 | if (gspca_dev->alt == 0) /* if bulk transfer */ |
620 | usb_clear_halt(gspca_dev->dev, | 612 | usb_clear_halt(gspca_dev->dev, |
621 | usb_rcvintpipe(gspca_dev->dev, | 613 | gspca_dev->urb[0]->pipe); |
622 | gspca_dev->cam.epaddr)); | ||
623 | 614 | ||
624 | /* start the cam */ | 615 | /* start the cam */ |
625 | ret = gspca_dev->sd_desc->start(gspca_dev); | 616 | ret = gspca_dev->sd_desc->start(gspca_dev); |