aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-10-01 05:45:36 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-01 16:22:14 -0400
commitdff274fd86e401880d2d10c1dd7fa1fcb6d2bdbc (patch)
treef21d8d06ffb5fc00857f33698bbb136e96874129
parent7eaf49667e23a11a1f6ec88dad51ad0e93b1445d (diff)
[media] ivtv: don't allow g/s_frequency for output device nodes
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/pci/ivtv/ivtv-driver.c1
-rw-r--r--drivers/media/pci/ivtv/ivtv-ioctl.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c
index eed95a396665..74e9a5032364 100644
--- a/drivers/media/pci/ivtv/ivtv-driver.c
+++ b/drivers/media/pci/ivtv/ivtv-driver.c
@@ -1325,6 +1325,7 @@ int ivtv_init_on_first_open(struct ivtv *itv)
1325 int video_input; 1325 int video_input;
1326 1326
1327 fh.itv = itv; 1327 fh.itv = itv;
1328 fh.type = IVTV_ENC_STREAM_TYPE_MPG;
1328 1329
1329 if (test_bit(IVTV_F_I_FAILED, &itv->i_flags)) 1330 if (test_bit(IVTV_F_I_FAILED, &itv->i_flags))
1330 return -ENXIO; 1331 return -ENXIO;
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index e5ce970266f3..5537c8842075 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -1064,7 +1064,10 @@ static int ivtv_s_output(struct file *file, void *fh, unsigned int outp)
1064static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency *vf) 1064static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
1065{ 1065{
1066 struct ivtv *itv = fh2id(fh)->itv; 1066 struct ivtv *itv = fh2id(fh)->itv;
1067 struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];
1067 1068
1069 if (s->vdev->vfl_dir)
1070 return -ENOTTY;
1068 if (vf->tuner != 0) 1071 if (vf->tuner != 0)
1069 return -EINVAL; 1072 return -EINVAL;
1070 1073
@@ -1075,7 +1078,10 @@ static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequency *
1075int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf) 1078int ivtv_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
1076{ 1079{
1077 struct ivtv *itv = fh2id(fh)->itv; 1080 struct ivtv *itv = fh2id(fh)->itv;
1081 struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];
1078 1082
1083 if (s->vdev->vfl_dir)
1084 return -ENOTTY;
1079 if (vf->tuner != 0) 1085 if (vf->tuner != 0)
1080 return -EINVAL; 1086 return -EINVAL;
1081 1087