diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-04 11:03:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-26 09:56:23 -0400 |
commit | ba9425bce9e162eee0741d9a94e0d6f68e0242ab (patch) | |
tree | 68a767a4c9427b040827dd2c1dd908dca040605c | |
parent | 0e8025b9f6011a6bd69d01080d584bc95a89d02e (diff) |
[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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-ioctl.c | 6 | ||||
-rw-r--r-- | drivers/media/radio/radio-si4713.c | 2 | ||||
-rw-r--r-- | include/media/v4l2-ioctl.h | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 99e35dd3d83e..d5cbb6177754 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c | |||
@@ -813,11 +813,13 @@ static int ivtv_g_audout(struct file *file, void *fh, struct v4l2_audioout *vin) | |||
813 | return ivtv_get_audio_output(itv, vin->index, vin); | 813 | return ivtv_get_audio_output(itv, vin->index, vin); |
814 | } | 814 | } |
815 | 815 | ||
816 | static int ivtv_s_audout(struct file *file, void *fh, struct v4l2_audioout *vout) | 816 | static int ivtv_s_audout(struct file *file, void *fh, const struct v4l2_audioout *vout) |
817 | { | 817 | { |
818 | struct ivtv *itv = fh2id(fh)->itv; | 818 | struct ivtv *itv = fh2id(fh)->itv; |
819 | 819 | ||
820 | return ivtv_get_audio_output(itv, vout->index, vout); | 820 | if (itv->card->video_outputs == NULL || vout->index != 0) |
821 | return -EINVAL; | ||
822 | return 0; | ||
821 | } | 823 | } |
822 | 824 | ||
823 | static int ivtv_enum_input(struct file *file, void *fh, struct v4l2_input *vin) | 825 | static int ivtv_enum_input(struct file *file, void *fh, struct v4l2_input *vin) |
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c index 5f366d16be26..1e04101485a3 100644 --- a/drivers/media/radio/radio-si4713.c +++ b/drivers/media/radio/radio-si4713.c | |||
@@ -83,7 +83,7 @@ static int radio_si4713_g_audout(struct file *file, void *priv, | |||
83 | } | 83 | } |
84 | 84 | ||
85 | static int radio_si4713_s_audout(struct file *file, void *priv, | 85 | static int radio_si4713_s_audout(struct file *file, void *priv, |
86 | struct v4l2_audioout *vao) | 86 | const struct v4l2_audioout *vao) |
87 | { | 87 | { |
88 | return vao->index ? -EINVAL : 0; | 88 | return vao->index ? -EINVAL : 0; |
89 | } | 89 | } |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index babbe09527cd..d4c7729e8eca 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -175,7 +175,7 @@ struct v4l2_ioctl_ops { | |||
175 | int (*vidioc_g_audout) (struct file *file, void *fh, | 175 | int (*vidioc_g_audout) (struct file *file, void *fh, |
176 | struct v4l2_audioout *a); | 176 | struct v4l2_audioout *a); |
177 | int (*vidioc_s_audout) (struct file *file, void *fh, | 177 | int (*vidioc_s_audout) (struct file *file, void *fh, |
178 | struct v4l2_audioout *a); | 178 | const struct v4l2_audioout *a); |
179 | int (*vidioc_g_modulator) (struct file *file, void *fh, | 179 | int (*vidioc_g_modulator) (struct file *file, void *fh, |
180 | struct v4l2_modulator *a); | 180 | struct v4l2_modulator *a); |
181 | int (*vidioc_s_modulator) (struct file *file, void *fh, | 181 | int (*vidioc_s_modulator) (struct file *file, void *fh, |