aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-01 19:30:24 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:56 -0400
commitd69b2e41a5f6d934d01cc62f314697a60356b466 (patch)
treeef50854a650d469c0002d366d6f14574765a0e6d /drivers/media/video/bt8xx/bttv-driver.c
parent7bf9746d936740f9797c810ad75411a6cdeb9f2f (diff)
V4L/DVB (7462): bttv: Fix some API non-compliances for some audio/input V4L2 calls
Thanks to Cyrill Gorcunov <gorcunov@gmail.com> for pointing this Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index af2c0c994186..79da9d01d715 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3117,12 +3117,18 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
3117 3117
3118static int bttv_g_audio(struct file *file, void *priv, struct v4l2_audio *a) 3118static int bttv_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
3119{ 3119{
3120 if (unlikely(a->index))
3121 return -EINVAL;
3122
3120 strcpy(a->name, "audio"); 3123 strcpy(a->name, "audio");
3121 return 0; 3124 return 0;
3122} 3125}
3123 3126
3124static int bttv_s_audio(struct file *file, void *priv, struct v4l2_audio *a) 3127static int bttv_s_audio(struct file *file, void *priv, struct v4l2_audio *a)
3125{ 3128{
3129 if (unlikely(a->index))
3130 return -EINVAL;
3131
3126 return 0; 3132 return 0;
3127} 3133}
3128 3134
@@ -3510,7 +3516,7 @@ static int radio_enum_input(struct file *file, void *priv,
3510 return -EINVAL; 3516 return -EINVAL;
3511 3517
3512 strcpy(i->name, "Radio"); 3518 strcpy(i->name, "Radio");
3513 i->type = V4L2_INPUT_TYPE_TUNER; 3519 i->type = V4L2_INPUT_TYPE_TUNER;
3514 3520
3515 return 0; 3521 return 0;
3516} 3522}
@@ -3518,10 +3524,9 @@ static int radio_enum_input(struct file *file, void *priv,
3518static int radio_g_audio(struct file *file, void *priv, 3524static int radio_g_audio(struct file *file, void *priv,
3519 struct v4l2_audio *a) 3525 struct v4l2_audio *a)
3520{ 3526{
3521 if (a->index != 0) 3527 if (unlikely(a->index))
3522 return -EINVAL; 3528 return -EINVAL;
3523 3529
3524 memset(a, 0, sizeof(*a));
3525 strcpy(a->name, "Radio"); 3530 strcpy(a->name, "Radio");
3526 3531
3527 return 0; 3532 return 0;
@@ -3543,11 +3548,17 @@ static int radio_s_tuner(struct file *file, void *priv,
3543static int radio_s_audio(struct file *file, void *priv, 3548static int radio_s_audio(struct file *file, void *priv,
3544 struct v4l2_audio *a) 3549 struct v4l2_audio *a)
3545{ 3550{
3551 if (unlikely(a->index))
3552 return -EINVAL;
3553
3546 return 0; 3554 return 0;
3547} 3555}
3548 3556
3549static int radio_s_input(struct file *filp, void *priv, unsigned int i) 3557static int radio_s_input(struct file *filp, void *priv, unsigned int i)
3550{ 3558{
3559 if (unlikely(i))
3560 return -EINVAL;
3561
3551 return 0; 3562 return 0;
3552} 3563}
3553 3564