diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-21 01:57:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-26 11:54:58 -0400 |
commit | a399810ca69d9d4bd30ab8c1678c7439e567f90b (patch) | |
tree | 32939ef77bc75c3a224d37cf4e885d7f808741bf /drivers/media/video/cx18/cx18-ioctl.c | |
parent | b654fcdc0ea3b6e5724c9873ae062bdfe7f28efe (diff) |
V4L/DVB (8482): videodev: move all ioctl callbacks to a new v4l2_ioctl_ops struct
All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in
a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it.
This ensures a clean separation between the const ops struct and the non-const
video_device struct.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-ioctl.c | 92 |
1 files changed, 48 insertions, 44 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index 0d74e59e503e..a7f839631d6a 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c | |||
@@ -787,50 +787,54 @@ int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, | |||
787 | return res; | 787 | return res; |
788 | } | 788 | } |
789 | 789 | ||
790 | void cx18_set_funcs(struct video_device *vdev) | 790 | static const struct v4l2_ioctl_ops cx18_ioctl_ops = { |
791 | { | 791 | .vidioc_querycap = cx18_querycap, |
792 | vdev->vidioc_querycap = cx18_querycap; | 792 | .vidioc_g_priority = cx18_g_priority, |
793 | vdev->vidioc_g_priority = cx18_g_priority; | 793 | .vidioc_s_priority = cx18_s_priority, |
794 | vdev->vidioc_s_priority = cx18_s_priority; | 794 | .vidioc_s_audio = cx18_s_audio, |
795 | vdev->vidioc_s_audio = cx18_s_audio; | 795 | .vidioc_g_audio = cx18_g_audio, |
796 | vdev->vidioc_g_audio = cx18_g_audio; | 796 | .vidioc_enumaudio = cx18_enumaudio, |
797 | vdev->vidioc_enumaudio = cx18_enumaudio; | 797 | .vidioc_enum_input = cx18_enum_input, |
798 | vdev->vidioc_enum_input = cx18_enum_input; | 798 | .vidioc_cropcap = cx18_cropcap, |
799 | vdev->vidioc_cropcap = cx18_cropcap; | 799 | .vidioc_s_crop = cx18_s_crop, |
800 | vdev->vidioc_s_crop = cx18_s_crop; | 800 | .vidioc_g_crop = cx18_g_crop, |
801 | vdev->vidioc_g_crop = cx18_g_crop; | 801 | .vidioc_g_input = cx18_g_input, |
802 | vdev->vidioc_g_input = cx18_g_input; | 802 | .vidioc_s_input = cx18_s_input, |
803 | vdev->vidioc_s_input = cx18_s_input; | 803 | .vidioc_g_frequency = cx18_g_frequency, |
804 | vdev->vidioc_g_frequency = cx18_g_frequency; | 804 | .vidioc_s_frequency = cx18_s_frequency, |
805 | vdev->vidioc_s_frequency = cx18_s_frequency; | 805 | .vidioc_s_tuner = cx18_s_tuner, |
806 | vdev->vidioc_s_tuner = cx18_s_tuner; | 806 | .vidioc_g_tuner = cx18_g_tuner, |
807 | vdev->vidioc_g_tuner = cx18_g_tuner; | 807 | .vidioc_g_enc_index = cx18_g_enc_index, |
808 | vdev->vidioc_g_enc_index = cx18_g_enc_index; | 808 | .vidioc_g_std = cx18_g_std, |
809 | vdev->vidioc_g_std = cx18_g_std; | 809 | .vidioc_s_std = cx18_s_std, |
810 | vdev->vidioc_s_std = cx18_s_std; | 810 | .vidioc_log_status = cx18_log_status, |
811 | vdev->vidioc_log_status = cx18_log_status; | 811 | .vidioc_enum_fmt_vid_cap = cx18_enum_fmt_vid_cap, |
812 | vdev->vidioc_enum_fmt_vid_cap = cx18_enum_fmt_vid_cap; | 812 | .vidioc_encoder_cmd = cx18_encoder_cmd, |
813 | vdev->vidioc_encoder_cmd = cx18_encoder_cmd; | 813 | .vidioc_try_encoder_cmd = cx18_try_encoder_cmd, |
814 | vdev->vidioc_try_encoder_cmd = cx18_try_encoder_cmd; | 814 | .vidioc_g_fmt_vid_cap = cx18_g_fmt_vid_cap, |
815 | vdev->vidioc_g_fmt_vid_cap = cx18_g_fmt_vid_cap; | 815 | .vidioc_g_fmt_vbi_cap = cx18_g_fmt_vbi_cap, |
816 | vdev->vidioc_g_fmt_vbi_cap = cx18_g_fmt_vbi_cap; | 816 | .vidioc_g_fmt_sliced_vbi_cap = cx18_g_fmt_sliced_vbi_cap, |
817 | vdev->vidioc_g_fmt_sliced_vbi_cap = cx18_g_fmt_sliced_vbi_cap; | 817 | .vidioc_s_fmt_vid_cap = cx18_s_fmt_vid_cap, |
818 | vdev->vidioc_s_fmt_vid_cap = cx18_s_fmt_vid_cap; | 818 | .vidioc_s_fmt_vbi_cap = cx18_s_fmt_vbi_cap, |
819 | vdev->vidioc_s_fmt_vbi_cap = cx18_s_fmt_vbi_cap; | 819 | .vidioc_s_fmt_sliced_vbi_cap = cx18_s_fmt_sliced_vbi_cap, |
820 | vdev->vidioc_s_fmt_sliced_vbi_cap = cx18_s_fmt_sliced_vbi_cap; | 820 | .vidioc_try_fmt_vid_cap = cx18_try_fmt_vid_cap, |
821 | vdev->vidioc_try_fmt_vid_cap = cx18_try_fmt_vid_cap; | 821 | .vidioc_try_fmt_vbi_cap = cx18_try_fmt_vbi_cap, |
822 | vdev->vidioc_try_fmt_vbi_cap = cx18_try_fmt_vbi_cap; | 822 | .vidioc_try_fmt_sliced_vbi_cap = cx18_try_fmt_sliced_vbi_cap, |
823 | vdev->vidioc_try_fmt_sliced_vbi_cap = cx18_try_fmt_sliced_vbi_cap; | 823 | .vidioc_g_sliced_vbi_cap = cx18_g_sliced_vbi_cap, |
824 | vdev->vidioc_g_sliced_vbi_cap = cx18_g_sliced_vbi_cap; | 824 | .vidioc_g_chip_ident = cx18_g_chip_ident, |
825 | vdev->vidioc_g_chip_ident = cx18_g_chip_ident; | ||
826 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 825 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
827 | vdev->vidioc_g_register = cx18_g_register; | 826 | .vidioc_g_register = cx18_g_register, |
828 | vdev->vidioc_s_register = cx18_s_register; | 827 | .vidioc_s_register = cx18_s_register, |
829 | #endif | 828 | #endif |
830 | vdev->vidioc_default = cx18_default; | 829 | .vidioc_default = cx18_default, |
831 | vdev->vidioc_queryctrl = cx18_queryctrl; | 830 | .vidioc_queryctrl = cx18_queryctrl, |
832 | vdev->vidioc_querymenu = cx18_querymenu; | 831 | .vidioc_querymenu = cx18_querymenu, |
833 | vdev->vidioc_g_ext_ctrls = cx18_g_ext_ctrls; | 832 | .vidioc_g_ext_ctrls = cx18_g_ext_ctrls, |
834 | vdev->vidioc_s_ext_ctrls = cx18_s_ext_ctrls; | 833 | .vidioc_s_ext_ctrls = cx18_s_ext_ctrls, |
835 | vdev->vidioc_try_ext_ctrls = cx18_try_ext_ctrls; | 834 | .vidioc_try_ext_ctrls = cx18_try_ext_ctrls, |
835 | }; | ||
836 | |||
837 | void cx18_set_funcs(struct video_device *vdev) | ||
838 | { | ||
839 | vdev->ioctl_ops = &cx18_ioctl_ops; | ||
836 | } | 840 | } |