aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-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/saa7134/saa7134-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/saa7134/saa7134-video.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c61
1 files changed, 33 insertions, 28 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 1a5137550e7..5e9cfc891be 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -2353,26 +2353,7 @@ static const struct file_operations video_fops =
2353 .llseek = no_llseek, 2353 .llseek = no_llseek,
2354}; 2354};
2355 2355
2356static const struct file_operations radio_fops = 2356static const struct v4l2_ioctl_ops video_ioctl_ops = {
2357{
2358 .owner = THIS_MODULE,
2359 .open = video_open,
2360 .release = video_release,
2361 .ioctl = video_ioctl2,
2362 .compat_ioctl = v4l_compat_ioctl32,
2363 .llseek = no_llseek,
2364};
2365
2366/* ----------------------------------------------------------- */
2367/* exported stuff */
2368
2369struct video_device saa7134_video_template =
2370{
2371 .name = "saa7134-video",
2372 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER |
2373 VID_TYPE_CLIPPING|VID_TYPE_SCALES,
2374 .fops = &video_fops,
2375 .minor = -1,
2376 .vidioc_querycap = saa7134_querycap, 2357 .vidioc_querycap = saa7134_querycap,
2377 .vidioc_enum_fmt_vid_cap = saa7134_enum_fmt_vid_cap, 2358 .vidioc_enum_fmt_vid_cap = saa7134_enum_fmt_vid_cap,
2378 .vidioc_g_fmt_vid_cap = saa7134_g_fmt_vid_cap, 2359 .vidioc_g_fmt_vid_cap = saa7134_g_fmt_vid_cap,
@@ -2421,16 +2402,18 @@ struct video_device saa7134_video_template =
2421 .vidioc_g_register = vidioc_g_register, 2402 .vidioc_g_register = vidioc_g_register,
2422 .vidioc_s_register = vidioc_s_register, 2403 .vidioc_s_register = vidioc_s_register,
2423#endif 2404#endif
2424 .tvnorms = SAA7134_NORMS,
2425 .current_norm = V4L2_STD_PAL,
2426}; 2405};
2427 2406
2428struct video_device saa7134_radio_template = 2407static const struct file_operations radio_fops = {
2429{ 2408 .owner = THIS_MODULE,
2430 .name = "saa7134-radio", 2409 .open = video_open,
2431 .type = VID_TYPE_TUNER, 2410 .release = video_release,
2432 .fops = &radio_fops, 2411 .ioctl = video_ioctl2,
2433 .minor = -1, 2412 .compat_ioctl = v4l_compat_ioctl32,
2413 .llseek = no_llseek,
2414};
2415
2416static const struct v4l2_ioctl_ops radio_ioctl_ops = {
2434 .vidioc_querycap = radio_querycap, 2417 .vidioc_querycap = radio_querycap,
2435 .vidioc_g_tuner = radio_g_tuner, 2418 .vidioc_g_tuner = radio_g_tuner,
2436 .vidioc_enum_input = radio_enum_input, 2419 .vidioc_enum_input = radio_enum_input,
@@ -2447,6 +2430,28 @@ struct video_device saa7134_radio_template =
2447 .vidioc_s_frequency = saa7134_s_frequency, 2430 .vidioc_s_frequency = saa7134_s_frequency,
2448}; 2431};
2449 2432
2433/* ----------------------------------------------------------- */
2434/* exported stuff */
2435
2436struct video_device saa7134_video_template = {
2437 .name = "saa7134-video",
2438 .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER |
2439 VID_TYPE_CLIPPING|VID_TYPE_SCALES,
2440 .fops = &video_fops,
2441 .ioctl_ops = &video_ioctl_ops,
2442 .minor = -1,
2443 .tvnorms = SAA7134_NORMS,
2444 .current_norm = V4L2_STD_PAL,
2445};
2446
2447struct video_device saa7134_radio_template = {
2448 .name = "saa7134-radio",
2449 .type = VID_TYPE_TUNER,
2450 .fops = &radio_fops,
2451 .ioctl_ops = &radio_ioctl_ops,
2452 .minor = -1,
2453};
2454
2450int saa7134_video_init1(struct saa7134_dev *dev) 2455int saa7134_video_init1(struct saa7134_dev *dev)
2451{ 2456{
2452 /* sanitycheck insmod options */ 2457 /* sanitycheck insmod options */