diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-12-30 04:58:20 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-02 14:11:12 -0500 |
commit | bec43661b1dc0075b7445223ba775674133b164d (patch) | |
tree | 2a09ad5cc78799985e5cfb789f0a23db58e70499 /drivers/media/video/cx23885 | |
parent | dfa9a5ae679ff2d23caa995d0f55a19abaf0596e (diff) |
V4L/DVB (10135): v4l2: introduce v4l2_file_operations.
Introduce a struct v4l2_file_operations for v4l2 drivers.
Remove the unnecessary inode argument.
Move compat32 handling (and llseek) into the v4l2-dev core: this is now
handled in the v4l2 core and no longer in the drivers themselves.
Note that this changeset reverts an earlier patch that changed the return
type of__video_ioctl2 from int to long. This change will be reinstated
later in a much improved version.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-417.c | 10 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-video.c | 14 |
2 files changed, 9 insertions, 15 deletions
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c index 798d24024353..d9888136255d 100644 --- a/drivers/media/video/cx23885/cx23885-417.c +++ b/drivers/media/video/cx23885/cx23885-417.c | |||
@@ -1573,9 +1573,9 @@ static int vidioc_queryctrl(struct file *file, void *priv, | |||
1573 | return cx23885_queryctrl(dev, c); | 1573 | return cx23885_queryctrl(dev, c); |
1574 | } | 1574 | } |
1575 | 1575 | ||
1576 | static int mpeg_open(struct inode *inode, struct file *file) | 1576 | static int mpeg_open(struct file *file) |
1577 | { | 1577 | { |
1578 | int minor = iminor(inode); | 1578 | int minor = video_devdata(file)->minor; |
1579 | struct cx23885_dev *h, *dev = NULL; | 1579 | struct cx23885_dev *h, *dev = NULL; |
1580 | struct list_head *list; | 1580 | struct list_head *list; |
1581 | struct cx23885_fh *fh; | 1581 | struct cx23885_fh *fh; |
@@ -1617,7 +1617,7 @@ static int mpeg_open(struct inode *inode, struct file *file) | |||
1617 | return 0; | 1617 | return 0; |
1618 | } | 1618 | } |
1619 | 1619 | ||
1620 | static int mpeg_release(struct inode *inode, struct file *file) | 1620 | static int mpeg_release(struct file *file) |
1621 | { | 1621 | { |
1622 | struct cx23885_fh *fh = file->private_data; | 1622 | struct cx23885_fh *fh = file->private_data; |
1623 | struct cx23885_dev *dev = fh->dev; | 1623 | struct cx23885_dev *dev = fh->dev; |
@@ -1694,15 +1694,13 @@ static int mpeg_mmap(struct file *file, struct vm_area_struct *vma) | |||
1694 | return videobuf_mmap_mapper(&fh->mpegq, vma); | 1694 | return videobuf_mmap_mapper(&fh->mpegq, vma); |
1695 | } | 1695 | } |
1696 | 1696 | ||
1697 | static struct file_operations mpeg_fops = { | 1697 | static struct v4l2_file_operations mpeg_fops = { |
1698 | .owner = THIS_MODULE, | 1698 | .owner = THIS_MODULE, |
1699 | .open = mpeg_open, | 1699 | .open = mpeg_open, |
1700 | .release = mpeg_release, | 1700 | .release = mpeg_release, |
1701 | .read = mpeg_read, | 1701 | .read = mpeg_read, |
1702 | .poll = mpeg_poll, | 1702 | .poll = mpeg_poll, |
1703 | .mmap = mpeg_mmap, | 1703 | .mmap = mpeg_mmap, |
1704 | .ioctl = video_ioctl2, | ||
1705 | .llseek = no_llseek, | ||
1706 | }; | 1704 | }; |
1707 | 1705 | ||
1708 | static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { | 1706 | static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index c742a10be5cb..637c4d008846 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
@@ -718,9 +718,9 @@ static int get_resource(struct cx23885_fh *fh) | |||
718 | } | 718 | } |
719 | } | 719 | } |
720 | 720 | ||
721 | static int video_open(struct inode *inode, struct file *file) | 721 | static int video_open(struct file *file) |
722 | { | 722 | { |
723 | int minor = iminor(inode); | 723 | int minor = video_devdata(file)->minor; |
724 | struct cx23885_dev *h, *dev = NULL; | 724 | struct cx23885_dev *h, *dev = NULL; |
725 | struct cx23885_fh *fh; | 725 | struct cx23885_fh *fh; |
726 | struct list_head *list; | 726 | struct list_head *list; |
@@ -834,7 +834,7 @@ static unsigned int video_poll(struct file *file, | |||
834 | return 0; | 834 | return 0; |
835 | } | 835 | } |
836 | 836 | ||
837 | static int video_release(struct inode *inode, struct file *file) | 837 | static int video_release(struct file *file) |
838 | { | 838 | { |
839 | struct cx23885_fh *fh = file->private_data; | 839 | struct cx23885_fh *fh = file->private_data; |
840 | struct cx23885_dev *dev = fh->dev; | 840 | struct cx23885_dev *dev = fh->dev; |
@@ -1422,7 +1422,7 @@ int cx23885_video_irq(struct cx23885_dev *dev, u32 status) | |||
1422 | /* ----------------------------------------------------------- */ | 1422 | /* ----------------------------------------------------------- */ |
1423 | /* exported stuff */ | 1423 | /* exported stuff */ |
1424 | 1424 | ||
1425 | static const struct file_operations video_fops = { | 1425 | static const struct v4l2_file_operations video_fops = { |
1426 | .owner = THIS_MODULE, | 1426 | .owner = THIS_MODULE, |
1427 | .open = video_open, | 1427 | .open = video_open, |
1428 | .release = video_release, | 1428 | .release = video_release, |
@@ -1430,8 +1430,6 @@ static const struct file_operations video_fops = { | |||
1430 | .poll = video_poll, | 1430 | .poll = video_poll, |
1431 | .mmap = video_mmap, | 1431 | .mmap = video_mmap, |
1432 | .ioctl = video_ioctl2, | 1432 | .ioctl = video_ioctl2, |
1433 | .compat_ioctl = v4l_compat_ioctl32, | ||
1434 | .llseek = no_llseek, | ||
1435 | }; | 1433 | }; |
1436 | 1434 | ||
1437 | static const struct v4l2_ioctl_ops video_ioctl_ops = { | 1435 | static const struct v4l2_ioctl_ops video_ioctl_ops = { |
@@ -1479,13 +1477,11 @@ static struct video_device cx23885_video_template = { | |||
1479 | .current_norm = V4L2_STD_NTSC_M, | 1477 | .current_norm = V4L2_STD_NTSC_M, |
1480 | }; | 1478 | }; |
1481 | 1479 | ||
1482 | static const struct file_operations radio_fops = { | 1480 | static const struct v4l2_file_operations radio_fops = { |
1483 | .owner = THIS_MODULE, | 1481 | .owner = THIS_MODULE, |
1484 | .open = video_open, | 1482 | .open = video_open, |
1485 | .release = video_release, | 1483 | .release = video_release, |
1486 | .ioctl = video_ioctl2, | 1484 | .ioctl = video_ioctl2, |
1487 | .compat_ioctl = v4l_compat_ioctl32, | ||
1488 | .llseek = no_llseek, | ||
1489 | }; | 1485 | }; |
1490 | 1486 | ||
1491 | 1487 | ||