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/bt8xx/bttv-driver.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/bt8xx/bttv-driver.c')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 33c72055447d..dfa399da587d 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -3358,10 +3358,7 @@ static const struct file_operations bttv_fops = | |||
3358 | .poll = bttv_poll, | 3358 | .poll = bttv_poll, |
3359 | }; | 3359 | }; |
3360 | 3360 | ||
3361 | static struct video_device bttv_video_template = | 3361 | static const struct v4l2_ioctl_ops bttv_ioctl_ops = { |
3362 | { | ||
3363 | .fops = &bttv_fops, | ||
3364 | .minor = -1, | ||
3365 | .vidioc_querycap = bttv_querycap, | 3362 | .vidioc_querycap = bttv_querycap, |
3366 | .vidioc_enum_fmt_vid_cap = bttv_enum_fmt_vid_cap, | 3363 | .vidioc_enum_fmt_vid_cap = bttv_enum_fmt_vid_cap, |
3367 | .vidioc_g_fmt_vid_cap = bttv_g_fmt_vid_cap, | 3364 | .vidioc_g_fmt_vid_cap = bttv_g_fmt_vid_cap, |
@@ -3412,8 +3409,14 @@ static struct video_device bttv_video_template = | |||
3412 | .vidioc_g_register = bttv_g_register, | 3409 | .vidioc_g_register = bttv_g_register, |
3413 | .vidioc_s_register = bttv_s_register, | 3410 | .vidioc_s_register = bttv_s_register, |
3414 | #endif | 3411 | #endif |
3415 | .tvnorms = BTTV_NORMS, | 3412 | }; |
3416 | .current_norm = V4L2_STD_PAL, | 3413 | |
3414 | static struct video_device bttv_video_template = { | ||
3415 | .fops = &bttv_fops, | ||
3416 | .minor = -1, | ||
3417 | .ioctl_ops = &bttv_ioctl_ops, | ||
3418 | .tvnorms = BTTV_NORMS, | ||
3419 | .current_norm = V4L2_STD_PAL, | ||
3417 | }; | 3420 | }; |
3418 | 3421 | ||
3419 | /* ----------------------------------------------------------------------- */ | 3422 | /* ----------------------------------------------------------------------- */ |
@@ -3636,10 +3639,7 @@ static const struct file_operations radio_fops = | |||
3636 | .poll = radio_poll, | 3639 | .poll = radio_poll, |
3637 | }; | 3640 | }; |
3638 | 3641 | ||
3639 | static struct video_device radio_template = | 3642 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { |
3640 | { | ||
3641 | .fops = &radio_fops, | ||
3642 | .minor = -1, | ||
3643 | .vidioc_querycap = radio_querycap, | 3643 | .vidioc_querycap = radio_querycap, |
3644 | .vidioc_g_tuner = radio_g_tuner, | 3644 | .vidioc_g_tuner = radio_g_tuner, |
3645 | .vidioc_enum_input = radio_enum_input, | 3645 | .vidioc_enum_input = radio_enum_input, |
@@ -3656,6 +3656,12 @@ static struct video_device radio_template = | |||
3656 | .vidioc_s_frequency = bttv_s_frequency, | 3656 | .vidioc_s_frequency = bttv_s_frequency, |
3657 | }; | 3657 | }; |
3658 | 3658 | ||
3659 | static struct video_device radio_template = { | ||
3660 | .fops = &radio_fops, | ||
3661 | .minor = -1, | ||
3662 | .ioctl_ops = &radio_ioctl_ops, | ||
3663 | }; | ||
3664 | |||
3659 | /* ----------------------------------------------------------------------- */ | 3665 | /* ----------------------------------------------------------------------- */ |
3660 | /* some debug code */ | 3666 | /* some debug code */ |
3661 | 3667 | ||