aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-21 01:57:38 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-26 11:54:58 -0400
commita399810ca69d9d4bd30ab8c1678c7439e567f90b (patch)
tree32939ef77bc75c3a224d37cf4e885d7f808741bf /drivers/media/video/em28xx/em28xx-video.c
parentb654fcdc0ea3b6e5724c9873ae062bdfe7f28efe (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/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 67c62eaa5b6d..fcfc7413f74c 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1764,20 +1764,7 @@ static const struct file_operations em28xx_v4l_fops = {
1764 .compat_ioctl = v4l_compat_ioctl32, 1764 .compat_ioctl = v4l_compat_ioctl32,
1765}; 1765};
1766 1766
1767static const struct file_operations radio_fops = { 1767static const struct v4l2_ioctl_ops video_ioctl_ops = {
1768 .owner = THIS_MODULE,
1769 .open = em28xx_v4l2_open,
1770 .release = em28xx_v4l2_close,
1771 .ioctl = video_ioctl2,
1772 .compat_ioctl = v4l_compat_ioctl32,
1773 .llseek = no_llseek,
1774};
1775
1776static const struct video_device em28xx_video_template = {
1777 .fops = &em28xx_v4l_fops,
1778 .release = video_device_release,
1779
1780 .minor = -1,
1781 .vidioc_querycap = vidioc_querycap, 1768 .vidioc_querycap = vidioc_querycap,
1782 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, 1769 .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
1783 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, 1770 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
@@ -1815,16 +1802,29 @@ static const struct video_device em28xx_video_template = {
1815#ifdef CONFIG_VIDEO_V4L1_COMPAT 1802#ifdef CONFIG_VIDEO_V4L1_COMPAT
1816 .vidiocgmbuf = vidiocgmbuf, 1803 .vidiocgmbuf = vidiocgmbuf,
1817#endif 1804#endif
1805};
1806
1807static const struct video_device em28xx_video_template = {
1808 .fops = &em28xx_v4l_fops,
1809 .release = video_device_release,
1810 .ioctl_ops = &video_ioctl_ops,
1811
1812 .minor = -1,
1818 1813
1819 .tvnorms = V4L2_STD_ALL, 1814 .tvnorms = V4L2_STD_ALL,
1820 .current_norm = V4L2_STD_PAL, 1815 .current_norm = V4L2_STD_PAL,
1821}; 1816};
1822 1817
1823static struct video_device em28xx_radio_template = { 1818static const struct file_operations radio_fops = {
1824 .name = "em28xx-radio", 1819 .owner = THIS_MODULE,
1825 .type = VID_TYPE_TUNER, 1820 .open = em28xx_v4l2_open,
1826 .fops = &radio_fops, 1821 .release = em28xx_v4l2_close,
1827 .minor = -1, 1822 .ioctl = video_ioctl2,
1823 .compat_ioctl = v4l_compat_ioctl32,
1824 .llseek = no_llseek,
1825};
1826
1827static const struct v4l2_ioctl_ops radio_ioctl_ops = {
1828 .vidioc_querycap = radio_querycap, 1828 .vidioc_querycap = radio_querycap,
1829 .vidioc_g_tuner = radio_g_tuner, 1829 .vidioc_g_tuner = radio_g_tuner,
1830 .vidioc_enum_input = radio_enum_input, 1830 .vidioc_enum_input = radio_enum_input,
@@ -1843,6 +1843,14 @@ static struct video_device em28xx_radio_template = {
1843#endif 1843#endif
1844}; 1844};
1845 1845
1846static struct video_device em28xx_radio_template = {
1847 .name = "em28xx-radio",
1848 .type = VID_TYPE_TUNER,
1849 .fops = &radio_fops,
1850 .ioctl_ops = &radio_ioctl_ops,
1851 .minor = -1,
1852};
1853
1846/******************************** usb interface ******************************/ 1854/******************************** usb interface ******************************/
1847 1855
1848 1856