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>
这个提交包含在:
Hans Verkuil
2008-07-21 02:57:38 -03:00
提交者 Mauro Carvalho Chehab
父节点 b654fcdc0e
当前提交 a399810ca6
修改 38 个文件,包含 980 行新增828 行删除

查看文件

@@ -374,13 +374,7 @@ static int vidioc_s_ctrl (struct file *file, void *priv,
return -EINVAL;
}
static struct video_device maxiradio_radio =
{
.owner = THIS_MODULE,
.name = "Maxi Radio FM2000 radio",
.type = VID_TYPE_TUNER,
.fops = &maxiradio_fops,
static const struct v4l2_ioctl_ops maxiradio_ioctl_ops = {
.vidioc_querycap = vidioc_querycap,
.vidioc_g_tuner = vidioc_g_tuner,
.vidioc_s_tuner = vidioc_s_tuner,
@@ -395,6 +389,14 @@ static struct video_device maxiradio_radio =
.vidioc_s_ctrl = vidioc_s_ctrl,
};
static struct video_device maxiradio_radio = {
.owner = THIS_MODULE,
.name = "Maxi Radio FM2000 radio",
.type = VID_TYPE_TUNER,
.fops = &maxiradio_fops,
.ioctl_ops = &maxiradio_ioctl_ops,
};
static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{
if(!request_region(pci_resource_start(pdev, 0),