提交 ba9425bc 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] v4l2: make vidioc_s_audout const

Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_s_audout.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 0e8025b9
...@@ -813,11 +813,13 @@ static int ivtv_g_audout(struct file *file, void *fh, struct v4l2_audioout *vin) ...@@ -813,11 +813,13 @@ static int ivtv_g_audout(struct file *file, void *fh, struct v4l2_audioout *vin)
return ivtv_get_audio_output(itv, vin->index, vin); return ivtv_get_audio_output(itv, vin->index, vin);
} }
static int ivtv_s_audout(struct file *file, void *fh, struct v4l2_audioout *vout) static int ivtv_s_audout(struct file *file, void *fh, const struct v4l2_audioout *vout)
{ {
struct ivtv *itv = fh2id(fh)->itv; struct ivtv *itv = fh2id(fh)->itv;
return ivtv_get_audio_output(itv, vout->index, vout); if (itv->card->video_outputs == NULL || vout->index != 0)
return -EINVAL;
return 0;
} }
static int ivtv_enum_input(struct file *file, void *fh, struct v4l2_input *vin) static int ivtv_enum_input(struct file *file, void *fh, struct v4l2_input *vin)
......
...@@ -83,7 +83,7 @@ static int radio_si4713_g_audout(struct file *file, void *priv, ...@@ -83,7 +83,7 @@ static int radio_si4713_g_audout(struct file *file, void *priv,
} }
static int radio_si4713_s_audout(struct file *file, void *priv, static int radio_si4713_s_audout(struct file *file, void *priv,
struct v4l2_audioout *vao) const struct v4l2_audioout *vao)
{ {
return vao->index ? -EINVAL : 0; return vao->index ? -EINVAL : 0;
} }
......
...@@ -175,7 +175,7 @@ struct v4l2_ioctl_ops { ...@@ -175,7 +175,7 @@ struct v4l2_ioctl_ops {
int (*vidioc_g_audout) (struct file *file, void *fh, int (*vidioc_g_audout) (struct file *file, void *fh,
struct v4l2_audioout *a); struct v4l2_audioout *a);
int (*vidioc_s_audout) (struct file *file, void *fh, int (*vidioc_s_audout) (struct file *file, void *fh,
struct v4l2_audioout *a); const struct v4l2_audioout *a);
int (*vidioc_g_modulator) (struct file *file, void *fh, int (*vidioc_g_modulator) (struct file *file, void *fh,
struct v4l2_modulator *a); struct v4l2_modulator *a);
int (*vidioc_s_modulator) (struct file *file, void *fh, int (*vidioc_s_modulator) (struct file *file, void *fh,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册