[media] bttv: fix ENUM_INPUT and S_INPUT

- Fix ENUM_INPUT audioset.
- Fix incorrect input check in s_input.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Hans Verkuil 2013-01-31 08:45:13 -03:00 committed by Mauro Carvalho Chehab
parent 1b9e94dc69
commit f74f89cb1c
1 changed files with 5 additions and 10 deletions

View File

@ -1923,7 +1923,7 @@ static int bttv_enum_input(struct file *file, void *priv,
} }
i->type = V4L2_INPUT_TYPE_CAMERA; i->type = V4L2_INPUT_TYPE_CAMERA;
i->audioset = 1; i->audioset = 0;
if (btv->tuner_type != TUNER_ABSENT && i->index == 0) { if (btv->tuner_type != TUNER_ABSENT && i->index == 0) {
sprintf(i->name, "Television"); sprintf(i->name, "Television");
@ -1964,21 +1964,16 @@ static int bttv_s_input(struct file *file, void *priv, unsigned int i)
{ {
struct bttv_fh *fh = priv; struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv; struct bttv *btv = fh->btv;
int err; int err;
err = v4l2_prio_check(&btv->prio, fh->prio); err = v4l2_prio_check(&btv->prio, fh->prio);
if (unlikely(err)) if (err)
goto err; return err;
if (i > bttv_tvcards[btv->c.type].video_inputs) { if (i >= bttv_tvcards[btv->c.type].video_inputs)
err = -EINVAL; return -EINVAL;
goto err;
}
set_input(btv, i, btv->tvnorm); set_input(btv, i, btv->tvnorm);
err:
return 0; return 0;
} }