Skip to content

Commit

Permalink
[media] ivtv: don't allow g/s_frequency for output device nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 1, 2012
1 parent 7eaf496 commit dff274f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/pci/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,7 @@ int ivtv_init_on_first_open(struct ivtv *itv)
int video_input;

fh.itv = itv;
fh.type = IVTV_ENC_STREAM_TYPE_MPG;

if (test_bit(IVTV_F_I_FAILED, &itv->i_flags))
return -ENXIO;
Expand Down
6 changes: 6 additions & 0 deletions drivers/media/pci/ivtv/ivtv-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,10 @@ static int ivtv_s_output(struct file *file, void *fh, unsigned int outp)
static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
{
struct ivtv *itv = fh2id(fh)->itv;
struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];

if (s->vdev->vfl_dir)
return -ENOTTY;
if (vf->tuner != 0)
return -EINVAL;

Expand All @@ -1075,7 +1078,10 @@ static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency *
int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
{
struct ivtv *itv = fh2id(fh)->itv;
struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];

if (s->vdev->vfl_dir)
return -ENOTTY;
if (vf->tuner != 0)
return -EINVAL;

Expand Down

0 comments on commit dff274f

Please sign in to comment.