[media] gspca - ov519: Don't do USB exchanges after disconnection
authorJean-François Moine <moinejf@free.fr>
Thu, 11 Nov 2010 09:20:42 +0000 (06:20 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 29 Dec 2010 10:16:40 +0000 (08:16 -0200)
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/gspca/ov519.c
drivers/media/video/gspca/w996Xcf.c

index 7e86faf12f5b5fb54e250d4906a9c780f2a93395..ed70229b0276a8b9e96772171c3d57f42b27f7db 100644 (file)
@@ -3937,6 +3937,8 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
 {
        struct sd *sd = (struct sd *) gspca_dev;
 
+       if (!sd->gspca_dev.present)
+               return;
        if (sd->bridge == BRIDGE_W9968CF)
                w9968cf_stop0(sd);
 
index 4066ac8c45a0fc76acb7fc7b944979be5bad4d14..b5a93e3795706b5801f4dae05e96fe0c71283342 100644 (file)
@@ -549,10 +549,8 @@ static int w9968cf_mode_init_regs(struct sd *sd)
 
 static void w9968cf_stop0(struct sd *sd)
 {
-       if (sd->gspca_dev.present) {
-               reg_w(sd, 0x39, 0x0000); /* disable JPEG encoder */
-               reg_w(sd, 0x16, 0x0000); /* stop video capture */
-       }
+       reg_w(sd, 0x39, 0x0000); /* disable JPEG encoder */
+       reg_w(sd, 0x16, 0x0000); /* stop video capture */
 }
 
 /* The w9968cf docs say that a 0 sized packet means EOF (and also SOF