summaryrefslogtreecommitdiff
path: root/drivers/media/usb/cx231xx/cx231xx-video.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-09-13 19:54:36 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 21:25:58 +0400
commitb251f95767e1b13b9b32b207b53f5be1c491899e (patch)
tree775392f7e2d90ee3112d8909107caa20dea99fc9 /drivers/media/usb/cx231xx/cx231xx-video.c
parent06c46003f7077cce7f87a75d327635e45c6d2b64 (diff)
downloadlinux-b251f95767e1b13b9b32b207b53f5be1c491899e.tar.xz
[media] cx231xx: fix tuner compliance issues
The g_tuner call wasn't passed on to the subdevices, g_frequency didn't check for invalid tuners and a low-level function that was expected to return 0 or a negative error returned a positive number instead, causing s_frequency to return bogus errors. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-video.c')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index a31f7daef3dd..2b7b0944b7b4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -1322,6 +1322,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
t->capability = V4L2_TUNER_CAP_NORM;
t->rangehigh = 0xffffffffUL;
t->signal = 0xffff; /* LOCKED */
+ call_all(dev, tuner, g_tuner, t);
return 0;
}
@@ -1350,6 +1351,9 @@ static int vidioc_g_frequency(struct file *file, void *priv,
struct cx231xx_fh *fh = priv;
struct cx231xx *dev = fh->dev;
+ if (f->tuner)
+ return -EINVAL;
+
f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
f->frequency = dev->ctl_freq;