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/cx23885 | |
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/cx23885')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-417.c | 20 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 16 |
2 files changed, 22 insertions, 14 deletions
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c index 4d0dcb06c19d..9d15d8a353fa 100644 --- a/drivers/media/video/cx23885/cx23885-417.c +++ b/drivers/media/video/cx23885/cx23885-417.c | |||
@@ -1700,14 +1700,7 @@ static struct file_operations mpeg_fops = { | |||
1700 | .llseek = no_llseek, | 1700 | .llseek = no_llseek, |
1701 | }; | 1701 | }; |
1702 | 1702 | ||
1703 | static struct video_device cx23885_mpeg_template = { | 1703 | static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { |
1704 | .name = "cx23885", | ||
1705 | .type = VID_TYPE_CAPTURE | | ||
1706 | VID_TYPE_TUNER | | ||
1707 | VID_TYPE_SCALES | | ||
1708 | VID_TYPE_MPEG_ENCODER, | ||
1709 | .fops = &mpeg_fops, | ||
1710 | .minor = -1, | ||
1711 | .vidioc_s_std = vidioc_s_std, | 1704 | .vidioc_s_std = vidioc_s_std, |
1712 | .vidioc_enum_input = vidioc_enum_input, | 1705 | .vidioc_enum_input = vidioc_enum_input, |
1713 | .vidioc_g_input = vidioc_g_input, | 1706 | .vidioc_g_input = vidioc_g_input, |
@@ -1736,6 +1729,17 @@ static struct video_device cx23885_mpeg_template = { | |||
1736 | .vidioc_queryctrl = vidioc_queryctrl, | 1729 | .vidioc_queryctrl = vidioc_queryctrl, |
1737 | }; | 1730 | }; |
1738 | 1731 | ||
1732 | static struct video_device cx23885_mpeg_template = { | ||
1733 | .name = "cx23885", | ||
1734 | .type = VID_TYPE_CAPTURE | | ||
1735 | VID_TYPE_TUNER | | ||
1736 | VID_TYPE_SCALES | | ||
1737 | VID_TYPE_MPEG_ENCODER, | ||
1738 | .fops = &mpeg_fops, | ||
1739 | .ioctl_ops = &mpeg_ioctl_ops, | ||
1740 | .minor = -1, | ||
1741 | }; | ||
1742 | |||
1739 | void cx23885_417_unregister(struct cx23885_dev *dev) | 1743 | void cx23885_417_unregister(struct cx23885_dev *dev) |
1740 | { | 1744 | { |
1741 | dprintk(1, "%s()\n", __func__); | 1745 | dprintk(1, "%s()\n", __func__); |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 245712e45f69..308caa2085ba 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -1434,12 +1434,7 @@ static const struct file_operations video_fops = { | |||
1434 | .llseek = no_llseek, | 1434 | .llseek = no_llseek, |
1435 | }; | 1435 | }; |
1436 | 1436 | ||
1437 | static struct video_device cx23885_vbi_template; | 1437 | static const struct v4l2_ioctl_ops video_ioctl_ops = { |
1438 | static struct video_device cx23885_video_template = { | ||
1439 | .name = "cx23885-video", | ||
1440 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES, | ||
1441 | .fops = &video_fops, | ||
1442 | .minor = -1, | ||
1443 | .vidioc_querycap = vidioc_querycap, | 1438 | .vidioc_querycap = vidioc_querycap, |
1444 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, | 1439 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, |
1445 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, | 1440 | .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, |
@@ -1472,6 +1467,15 @@ static struct video_device cx23885_video_template = { | |||
1472 | .vidioc_g_register = vidioc_g_register, | 1467 | .vidioc_g_register = vidioc_g_register, |
1473 | .vidioc_s_register = vidioc_s_register, | 1468 | .vidioc_s_register = vidioc_s_register, |
1474 | #endif | 1469 | #endif |
1470 | }; | ||
1471 | |||
1472 | static struct video_device cx23885_vbi_template; | ||
1473 | static struct video_device cx23885_video_template = { | ||
1474 | .name = "cx23885-video", | ||
1475 | .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_SCALES, | ||
1476 | .fops = &video_fops, | ||
1477 | .minor = -1, | ||
1478 | .ioctl_ops = &video_ioctl_ops, | ||
1475 | .tvnorms = CX23885_NORMS, | 1479 | .tvnorms = CX23885_NORMS, |
1476 | .current_norm = V4L2_STD_NTSC_M, | 1480 | .current_norm = V4L2_STD_NTSC_M, |
1477 | }; | 1481 | }; |