This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-dvb.git tree:

Subject: V4L/DVB: tvp7002: fix query_dv_preset
Author:  Hans Verkuil <[email protected]>
Date:    Sat May 1 08:23:07 2010 -0300

If no signal or valid format is detected, then VIDIOC_QUERY_DV_PRESET must
return 0 and set the preset to V4L2_DV_INVALID.

This driver returned an error instead.

Also simplified the kernel messages a bit: change v4l2_err to v4l2_dbg (not
detecting a signal/valid format is not an error, so only print this info when
debug == 1) and do not call v4l_fill_dv_preset_info: it's overkill to do this
just for a debug message.

Thanks to Mats Randgaard for bringing this to my attention.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/video/tvp7002.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

---

http://git.linuxtv.org/v4l-dvb.git?a=commitdiff;h=ee90a1e38c354065fe63de5b5205ccd287276c69

diff --git a/drivers/media/video/tvp7002.c b/drivers/media/video/tvp7002.c
index 5a878bc..f860e3c 100644
--- a/drivers/media/video/tvp7002.c
+++ b/drivers/media/video/tvp7002.c
@@ -784,7 +784,6 @@ static int tvp7002_query_dv_preset(struct v4l2_subdev *sd,
                                                struct v4l2_dv_preset *qpreset)
 {
        const struct tvp7002_preset_definition *presets = tvp7002_presets;
-       struct v4l2_dv_enum_preset e_preset;
        struct tvp7002 *device;
        u8 progressive;
        u32 lpfr;
@@ -827,20 +826,18 @@ static int tvp7002_query_dv_preset(struct v4l2_subdev *sd,
                }
 
        if (index == NUM_PRESETS) {
-               v4l2_err(sd, "querystd error, lpf = %x, cpl = %x\n",
+               v4l2_dbg(1, debug, sd, "detection failed: lpf = %x, cpl = %x\n",
                                                                lpfr, cpln);
-               return -EINVAL;
+               /* Could not detect a signal, so return the 'invalid' preset */
+               qpreset->preset = V4L2_DV_INVALID;
+               return 0;
        }
 
-       if (v4l_fill_dv_preset_info(presets->preset, &e_preset))
-               return -EINVAL;
-
        /* Set values in found preset */
        qpreset->preset = presets->preset;
 
        /* Update lines per frame and clocks per line info */
-       v4l2_dbg(1, debug, sd, "Current preset: %d %d",
-                                       e_preset.width, e_preset.height);
+       v4l2_dbg(1, debug, sd, "detected preset: %d\n", presets->preset);
        return 0;
 }
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to