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/usbvision/usbvision-video.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/usbvision/usbvision-video.c')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 5984c7562035..7eccdc1ea2d7 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -1370,13 +1370,8 @@ static const struct file_operations usbvision_fops = { | |||
1370 | /* .poll = video_poll, */ | 1370 | /* .poll = video_poll, */ |
1371 | .compat_ioctl = v4l_compat_ioctl32, | 1371 | .compat_ioctl = v4l_compat_ioctl32, |
1372 | }; | 1372 | }; |
1373 | static struct video_device usbvision_video_template = { | 1373 | |
1374 | .owner = THIS_MODULE, | 1374 | static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { |
1375 | .type = VID_TYPE_TUNER | VID_TYPE_CAPTURE, | ||
1376 | .fops = &usbvision_fops, | ||
1377 | .name = "usbvision-video", | ||
1378 | .release = video_device_release, | ||
1379 | .minor = -1, | ||
1380 | .vidioc_querycap = vidioc_querycap, | 1375 | .vidioc_querycap = vidioc_querycap, |
1381 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, | 1376 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, |
1382 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, | 1377 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, |
@@ -1408,6 +1403,16 @@ static struct video_device usbvision_video_template = { | |||
1408 | .vidioc_g_register = vidioc_g_register, | 1403 | .vidioc_g_register = vidioc_g_register, |
1409 | .vidioc_s_register = vidioc_s_register, | 1404 | .vidioc_s_register = vidioc_s_register, |
1410 | #endif | 1405 | #endif |
1406 | }; | ||
1407 | |||
1408 | static struct video_device usbvision_video_template = { | ||
1409 | .owner = THIS_MODULE, | ||
1410 | .type = VID_TYPE_TUNER | VID_TYPE_CAPTURE, | ||
1411 | .fops = &usbvision_fops, | ||
1412 | .ioctl_ops = &usbvision_ioctl_ops, | ||
1413 | .name = "usbvision-video", | ||
1414 | .release = video_device_release, | ||
1415 | .minor = -1, | ||
1411 | .tvnorms = USBVISION_NORMS, | 1416 | .tvnorms = USBVISION_NORMS, |
1412 | .current_norm = V4L2_STD_PAL | 1417 | .current_norm = V4L2_STD_PAL |
1413 | }; | 1418 | }; |
@@ -1423,14 +1428,7 @@ static const struct file_operations usbvision_radio_fops = { | |||
1423 | .compat_ioctl = v4l_compat_ioctl32, | 1428 | .compat_ioctl = v4l_compat_ioctl32, |
1424 | }; | 1429 | }; |
1425 | 1430 | ||
1426 | static struct video_device usbvision_radio_template= | 1431 | static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { |
1427 | { | ||
1428 | .owner = THIS_MODULE, | ||
1429 | .type = VID_TYPE_TUNER, | ||
1430 | .fops = &usbvision_radio_fops, | ||
1431 | .name = "usbvision-radio", | ||
1432 | .release = video_device_release, | ||
1433 | .minor = -1, | ||
1434 | .vidioc_querycap = vidioc_querycap, | 1432 | .vidioc_querycap = vidioc_querycap, |
1435 | .vidioc_enum_input = vidioc_enum_input, | 1433 | .vidioc_enum_input = vidioc_enum_input, |
1436 | .vidioc_g_input = vidioc_g_input, | 1434 | .vidioc_g_input = vidioc_g_input, |
@@ -1444,6 +1442,16 @@ static struct video_device usbvision_radio_template= | |||
1444 | .vidioc_s_tuner = vidioc_s_tuner, | 1442 | .vidioc_s_tuner = vidioc_s_tuner, |
1445 | .vidioc_g_frequency = vidioc_g_frequency, | 1443 | .vidioc_g_frequency = vidioc_g_frequency, |
1446 | .vidioc_s_frequency = vidioc_s_frequency, | 1444 | .vidioc_s_frequency = vidioc_s_frequency, |
1445 | }; | ||
1446 | |||
1447 | static struct video_device usbvision_radio_template = { | ||
1448 | .owner = THIS_MODULE, | ||
1449 | .type = VID_TYPE_TUNER, | ||
1450 | .fops = &usbvision_radio_fops, | ||
1451 | .name = "usbvision-radio", | ||
1452 | .release = video_device_release, | ||
1453 | .minor = -1, | ||
1454 | .ioctl_ops = &usbvision_radio_ioctl_ops, | ||
1447 | 1455 | ||
1448 | .tvnorms = USBVISION_NORMS, | 1456 | .tvnorms = USBVISION_NORMS, |
1449 | .current_norm = V4L2_STD_PAL | 1457 | .current_norm = V4L2_STD_PAL |