Skip to content

Commit

Permalink
[media] TVP7002: Return V4L2_DV_INVALID if any of the errors occur
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mats Randgaard authored and Mauro Carvalho Chehab committed Sep 22, 2011
1 parent 699cc19 commit ab0ab19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/video/tvp7002.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit ab0ab19

Please sign in to comment.