[media] TVP7002: Return V4L2_DV_INVALID if any of the errors occur
authorMats Randgaard <mats.randgaard@tandberg.com>
Tue, 3 Aug 2010 07:18:03 +0000 (04:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 22 Sep 2011 13:25:14 +0000 (10:25 -0300)
Signed-off-by: Mats Randgaard <mats.randgaard@tandberg.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/tvp7002.c

index b799851bf3d0be20abfd593a6cf98d8b131e49ab..d78be2f710e540238084c23c379f969cc45d558c 100644 (file)
@@ -687,6 +687,9 @@ static int tvp7002_query_dv_preset(struct v4l2_subdev *sd,
        u8 cpl_msb;
        int index;
 
+       /* Return invalid preset if no active input is detected */
+       qpreset->preset = V4L2_DV_INVALID;
+
        device = to_tvp7002(sd);
 
        /* Read standards from device registers */
@@ -720,8 +723,6 @@ static int tvp7002_query_dv_preset(struct v4l2_subdev *sd,
        if (index == NUM_PRESETS) {
                v4l2_dbg(1, debug, sd, "detection failed: lpf = %x, cpl = %x\n",
                                                                lpfr, cpln);
-               /* Could not detect a signal, so return the 'invalid' preset */
-               qpreset->preset = V4L2_DV_INVALID;
                return 0;
        }