aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-typhoon.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-11-27 02:33:25 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:17:53 -0500
commita3a9e287daa1f299e318161b790b1c5902b1d869 (patch)
tree1f20db447f28a6346ce9d9fe2ebb0ff3eac65f96 /drivers/media/radio/radio-typhoon.c
parentcda4303f555316930a219cd7c03a1925526145f0 (diff)
V4L/DVB (13547): radio: add trivial checks on the tuner and type args.
Many radio drivers did not check the tuner and type field correctly for g/s_frequency. These checks have now been added. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-typhoon.c')
-rw-r--r--drivers/media/radio/radio-typhoon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c
index 3a98f1399495..03439282dfce 100644
--- a/drivers/media/radio/radio-typhoon.c
+++ b/drivers/media/radio/radio-typhoon.c
@@ -207,6 +207,8 @@ static int vidioc_g_frequency(struct file *file, void *priv,
207{ 207{
208 struct typhoon *dev = video_drvdata(file); 208 struct typhoon *dev = video_drvdata(file);
209 209
210 if (f->tuner != 0)
211 return -EINVAL;
210 f->type = V4L2_TUNER_RADIO; 212 f->type = V4L2_TUNER_RADIO;
211 f->frequency = dev->curfreq; 213 f->frequency = dev->curfreq;
212 return 0; 214 return 0;
@@ -217,6 +219,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
217{ 219{
218 struct typhoon *dev = video_drvdata(file); 220 struct typhoon *dev = video_drvdata(file);
219 221
222 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
223 return -EINVAL;
220 dev->curfreq = f->frequency; 224 dev->curfreq = f->frequency;
221 typhoon_setfreq(dev, dev->curfreq); 225 typhoon_setfreq(dev, dev->curfreq);
222 return 0; 226 return 0;