aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-tea5764.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-tea5764.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-tea5764.c')
-rw-r--r--drivers/media/radio/radio-tea5764.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
index 3cd76dddb6aa..730ffd9cdd3e 100644
--- a/drivers/media/radio/radio-tea5764.c
+++ b/drivers/media/radio/radio-tea5764.c
@@ -349,7 +349,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
349{ 349{
350 struct tea5764_device *radio = video_drvdata(file); 350 struct tea5764_device *radio = video_drvdata(file);
351 351
352 if (f->tuner != 0) 352 if (f->tuner != 0 || f->type != V4L2_TUNER_RADIO)
353 return -EINVAL; 353 return -EINVAL;
354 if (f->frequency == 0) { 354 if (f->frequency == 0) {
355 /* We special case this as a power down control. */ 355 /* We special case this as a power down control. */
@@ -370,6 +370,8 @@ static int vidioc_g_frequency(struct file *file, void *priv,
370 struct tea5764_device *radio = video_drvdata(file); 370 struct tea5764_device *radio = video_drvdata(file);
371 struct tea5764_regs *r = &radio->regs; 371 struct tea5764_regs *r = &radio->regs;
372 372
373 if (f->tuner != 0)
374 return -EINVAL;
373 tea5764_i2c_read(radio); 375 tea5764_i2c_read(radio);
374 memset(f, 0, sizeof(f)); 376 memset(f, 0, sizeof(f));
375 f->type = V4L2_TUNER_RADIO; 377 f->type = V4L2_TUNER_RADIO;