aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-tea5764.c
diff options
context:
space:
mode:
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;