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/saa7134 | |
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/saa7134')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 22 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 61 |
2 files changed, 45 insertions, 38 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 3854cc29752d..8b3f95167781 100644 --- a/drivers/media/video/saa7134/saa7134-empress.c +++ b/drivers/media/video/saa7134/saa7134-empress.c | |||
@@ -400,16 +400,7 @@ static const struct file_operations ts_fops = | |||
400 | .llseek = no_llseek, | 400 | .llseek = no_llseek, |
401 | }; | 401 | }; |
402 | 402 | ||
403 | /* ----------------------------------------------------------- */ | 403 | static const struct v4l2_ioctl_ops ts_ioctl_ops = { |
404 | |||
405 | static struct video_device saa7134_empress_template = | ||
406 | { | ||
407 | .name = "saa7134-empress", | ||
408 | .type = 0 /* FIXME */, | ||
409 | .type2 = 0 /* FIXME */, | ||
410 | .fops = &ts_fops, | ||
411 | .minor = -1, | ||
412 | |||
413 | .vidioc_querycap = empress_querycap, | 404 | .vidioc_querycap = empress_querycap, |
414 | .vidioc_enum_fmt_vid_cap = empress_enum_fmt_vid_cap, | 405 | .vidioc_enum_fmt_vid_cap = empress_enum_fmt_vid_cap, |
415 | .vidioc_s_fmt_vid_cap = empress_s_fmt_vid_cap, | 406 | .vidioc_s_fmt_vid_cap = empress_s_fmt_vid_cap, |
@@ -430,6 +421,17 @@ static struct video_device saa7134_empress_template = | |||
430 | .vidioc_querymenu = empress_querymenu, | 421 | .vidioc_querymenu = empress_querymenu, |
431 | .vidioc_g_ctrl = saa7134_g_ctrl, | 422 | .vidioc_g_ctrl = saa7134_g_ctrl, |
432 | .vidioc_s_ctrl = saa7134_s_ctrl, | 423 | .vidioc_s_ctrl = saa7134_s_ctrl, |
424 | }; | ||
425 | |||
426 | /* ----------------------------------------------------------- */ | ||
427 | |||
428 | static struct video_device saa7134_empress_template = { | ||
429 | .name = "saa7134-empress", | ||
430 | .type = 0 /* FIXME */, | ||
431 | .type2 = 0 /* FIXME */, | ||
432 | .fops = &ts_fops, | ||
433 | .minor = -1, | ||
434 | .ioctl_ops = &ts_ioctl_ops, | ||
433 | 435 | ||
434 | .tvnorms = SAA7134_NORMS, | 436 | .tvnorms = SAA7134_NORMS, |
435 | .current_norm = V4L2_STD_PAL, | 437 | .current_norm = V4L2_STD_PAL, |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 1a5137550e7a..5e9cfc891be8 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 | ||
2356 | static const struct file_operations radio_fops = | 2356 | static 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 | |||
2369 | struct 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 | ||
2428 | struct video_device saa7134_radio_template = | 2407 | static 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 | |||
2416 | static 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 | |||
2436 | struct 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 | |||
2447 | struct 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 | |||
2450 | int saa7134_video_init1(struct saa7134_dev *dev) | 2455 | int saa7134_video_init1(struct saa7134_dev *dev) |
2451 | { | 2456 | { |
2452 | /* sanitycheck insmod options */ | 2457 | /* sanitycheck insmod options */ |