V4L/DVB (9688): gspca: Reset the bulk URB status before resubmitting at irq level.
authorJean-Francois Moine <moinejf@free.fr>
Tue, 18 Nov 2008 07:19:52 +0000 (04:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:38 +0000 (17:53 -0200)
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/gspca.c

index a9a4a5fe4b130e6b5f80763d23cee93a6becf4fa..1da7a5c6a9a38c94341c75c55ffb28f43a7504b4 100644 (file)
@@ -173,7 +173,6 @@ static void fill_frame(struct gspca_dev *gspca_dev,
        }
 
        /* resubmit the URB */
-       urb->status = 0;
        st = usb_submit_urb(urb, GFP_ATOMIC);
        if (st < 0)
                PDEBUG(D_ERR|D_PACK, "usb_submit_urb() ret %d", st);
@@ -208,7 +207,13 @@ static void bulk_irq(struct urb *urb
        PDEBUG(D_PACK, "bulk irq");
        if (!gspca_dev->streaming)
                return;
-       if (urb->status != 0 && urb->status != -ECONNRESET) {
+       switch (urb->status) {
+       case 0:
+               break;
+       case -ECONNRESET:
+               urb->status = 0;
+               break;
+       default:
 #ifdef CONFIG_PM
                if (!gspca_dev->frozen)
 #endif