[media] em28xx: clear USB halt/stall condition in em28xx_init_usb_xfer when using...
authorFrank Schaefer <fschaefer.oss@googlemail.com>
Thu, 8 Nov 2012 17:11:43 +0000 (14:11 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 22 Dec 2012 20:00:30 +0000 (18:00 -0200)
[mchehab@redhat.com: Fix a CodingStyle issue: don't break strings
 into separate lines]

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/em28xx/em28xx-core.c

index d8a8e8bbb8708eef5d6e1e674669d0df4b770269..6b3485d2266ad014b095b43530b87db506b06e9a 100644 (file)
@@ -1174,6 +1174,16 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode,
                        return rc;
        }
 
+       if (xfer_bulk) {
+               rc = usb_clear_halt(dev->udev, usb_bufs->urb[0]->pipe);
+               if (rc < 0) {
+                       em28xx_err("failed to clear USB bulk endpoint stall/halt condition (error=%i)\n",
+                                  rc);
+                       em28xx_uninit_usb_xfer(dev, mode);
+                       return rc;
+               }
+       }
+
        init_waitqueue_head(&dma_q->wq);
        init_waitqueue_head(&vbi_dma_q->wq);