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/cx88 | |
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/cx88')
-rw-r--r-- | drivers/media/video/cx88/cx88-blackbird.c | 13 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-mpeg.c | 3 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 14 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88.h | 2 |
4 files changed, 13 insertions, 19 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c index e162a70748c5..7f5b8bfd08ac 100644 --- a/drivers/media/video/cx88/cx88-blackbird.c +++ b/drivers/media/video/cx88/cx88-blackbird.c | |||
@@ -1049,16 +1049,16 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id) | |||
1049 | 1049 | ||
1050 | /* FIXME: cx88_ioctl_hook not implemented */ | 1050 | /* FIXME: cx88_ioctl_hook not implemented */ |
1051 | 1051 | ||
1052 | static int mpeg_open(struct inode *inode, struct file *file) | 1052 | static int mpeg_open(struct file *file) |
1053 | { | 1053 | { |
1054 | int minor = iminor(inode); | 1054 | int minor = video_devdata(file)->minor; |
1055 | struct cx8802_dev *dev = NULL; | 1055 | struct cx8802_dev *dev = NULL; |
1056 | struct cx8802_fh *fh; | 1056 | struct cx8802_fh *fh; |
1057 | struct cx8802_driver *drv = NULL; | 1057 | struct cx8802_driver *drv = NULL; |
1058 | int err; | 1058 | int err; |
1059 | 1059 | ||
1060 | lock_kernel(); | 1060 | lock_kernel(); |
1061 | dev = cx8802_get_device(inode); | 1061 | dev = cx8802_get_device(minor); |
1062 | 1062 | ||
1063 | dprintk( 1, "%s\n", __func__); | 1063 | dprintk( 1, "%s\n", __func__); |
1064 | 1064 | ||
@@ -1114,7 +1114,7 @@ static int mpeg_open(struct inode *inode, struct file *file) | |||
1114 | return 0; | 1114 | return 0; |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | static int mpeg_release(struct inode *inode, struct file *file) | 1117 | static int mpeg_release(struct file *file) |
1118 | { | 1118 | { |
1119 | struct cx8802_fh *fh = file->private_data; | 1119 | struct cx8802_fh *fh = file->private_data; |
1120 | struct cx8802_dev *dev = fh->dev; | 1120 | struct cx8802_dev *dev = fh->dev; |
@@ -1132,7 +1132,7 @@ static int mpeg_release(struct inode *inode, struct file *file) | |||
1132 | kfree(fh); | 1132 | kfree(fh); |
1133 | 1133 | ||
1134 | /* Make sure we release the hardware */ | 1134 | /* Make sure we release the hardware */ |
1135 | dev = cx8802_get_device(inode); | 1135 | dev = cx8802_get_device(video_devdata(file)->minor); |
1136 | if (dev == NULL) | 1136 | if (dev == NULL) |
1137 | return -ENODEV; | 1137 | return -ENODEV; |
1138 | 1138 | ||
@@ -1178,7 +1178,7 @@ mpeg_mmap(struct file *file, struct vm_area_struct * vma) | |||
1178 | return videobuf_mmap_mapper(&fh->mpegq, vma); | 1178 | return videobuf_mmap_mapper(&fh->mpegq, vma); |
1179 | } | 1179 | } |
1180 | 1180 | ||
1181 | static const struct file_operations mpeg_fops = | 1181 | static const struct v4l2_file_operations mpeg_fops = |
1182 | { | 1182 | { |
1183 | .owner = THIS_MODULE, | 1183 | .owner = THIS_MODULE, |
1184 | .open = mpeg_open, | 1184 | .open = mpeg_open, |
@@ -1187,7 +1187,6 @@ static const struct file_operations mpeg_fops = | |||
1187 | .poll = mpeg_poll, | 1187 | .poll = mpeg_poll, |
1188 | .mmap = mpeg_mmap, | 1188 | .mmap = mpeg_mmap, |
1189 | .ioctl = video_ioctl2, | 1189 | .ioctl = video_ioctl2, |
1190 | .llseek = no_llseek, | ||
1191 | }; | 1190 | }; |
1192 | 1191 | ||
1193 | static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { | 1192 | static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { |
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c index a04fee235db6..59164fc94f5f 100644 --- a/drivers/media/video/cx88/cx88-mpeg.c +++ b/drivers/media/video/cx88/cx88-mpeg.c | |||
@@ -578,9 +578,8 @@ static int cx8802_resume_common(struct pci_dev *pci_dev) | |||
578 | 578 | ||
579 | #if defined(CONFIG_VIDEO_CX88_BLACKBIRD) || \ | 579 | #if defined(CONFIG_VIDEO_CX88_BLACKBIRD) || \ |
580 | defined(CONFIG_VIDEO_CX88_BLACKBIRD_MODULE) | 580 | defined(CONFIG_VIDEO_CX88_BLACKBIRD_MODULE) |
581 | struct cx8802_dev * cx8802_get_device(struct inode *inode) | 581 | struct cx8802_dev *cx8802_get_device(int minor) |
582 | { | 582 | { |
583 | int minor = iminor(inode); | ||
584 | struct cx8802_dev *dev; | 583 | struct cx8802_dev *dev; |
585 | 584 | ||
586 | list_for_each_entry(dev, &cx8802_devlist, devlist) | 585 | list_for_each_entry(dev, &cx8802_devlist, devlist) |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index b96ce991d968..b93b7ab99d8c 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -757,9 +757,9 @@ static int get_ressource(struct cx8800_fh *fh) | |||
757 | } | 757 | } |
758 | } | 758 | } |
759 | 759 | ||
760 | static int video_open(struct inode *inode, struct file *file) | 760 | static int video_open(struct file *file) |
761 | { | 761 | { |
762 | int minor = iminor(inode); | 762 | int minor = video_devdata(file)->minor; |
763 | struct cx8800_dev *h,*dev = NULL; | 763 | struct cx8800_dev *h,*dev = NULL; |
764 | struct cx88_core *core; | 764 | struct cx88_core *core; |
765 | struct cx8800_fh *fh; | 765 | struct cx8800_fh *fh; |
@@ -904,7 +904,7 @@ video_poll(struct file *file, struct poll_table_struct *wait) | |||
904 | return 0; | 904 | return 0; |
905 | } | 905 | } |
906 | 906 | ||
907 | static int video_release(struct inode *inode, struct file *file) | 907 | static int video_release(struct file *file) |
908 | { | 908 | { |
909 | struct cx8800_fh *fh = file->private_data; | 909 | struct cx8800_fh *fh = file->private_data; |
910 | struct cx8800_dev *dev = fh->dev; | 910 | struct cx8800_dev *dev = fh->dev; |
@@ -1693,7 +1693,7 @@ static irqreturn_t cx8800_irq(int irq, void *dev_id) | |||
1693 | /* ----------------------------------------------------------- */ | 1693 | /* ----------------------------------------------------------- */ |
1694 | /* exported stuff */ | 1694 | /* exported stuff */ |
1695 | 1695 | ||
1696 | static const struct file_operations video_fops = | 1696 | static const struct v4l2_file_operations video_fops = |
1697 | { | 1697 | { |
1698 | .owner = THIS_MODULE, | 1698 | .owner = THIS_MODULE, |
1699 | .open = video_open, | 1699 | .open = video_open, |
@@ -1702,8 +1702,6 @@ static const struct file_operations video_fops = | |||
1702 | .poll = video_poll, | 1702 | .poll = video_poll, |
1703 | .mmap = video_mmap, | 1703 | .mmap = video_mmap, |
1704 | .ioctl = video_ioctl2, | 1704 | .ioctl = video_ioctl2, |
1705 | .compat_ioctl = v4l_compat_ioctl32, | ||
1706 | .llseek = no_llseek, | ||
1707 | }; | 1705 | }; |
1708 | 1706 | ||
1709 | static const struct v4l2_ioctl_ops video_ioctl_ops = { | 1707 | static const struct v4l2_ioctl_ops video_ioctl_ops = { |
@@ -1752,14 +1750,12 @@ static struct video_device cx8800_video_template = { | |||
1752 | .current_norm = V4L2_STD_NTSC_M, | 1750 | .current_norm = V4L2_STD_NTSC_M, |
1753 | }; | 1751 | }; |
1754 | 1752 | ||
1755 | static const struct file_operations radio_fops = | 1753 | static const struct v4l2_file_operations radio_fops = |
1756 | { | 1754 | { |
1757 | .owner = THIS_MODULE, | 1755 | .owner = THIS_MODULE, |
1758 | .open = video_open, | 1756 | .open = video_open, |
1759 | .release = video_release, | 1757 | .release = video_release, |
1760 | .ioctl = video_ioctl2, | 1758 | .ioctl = video_ioctl2, |
1761 | .compat_ioctl = v4l_compat_ioctl32, | ||
1762 | .llseek = no_llseek, | ||
1763 | }; | 1759 | }; |
1764 | 1760 | ||
1765 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { | 1761 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index 20649b25f7ba..eb9ce30dc5e6 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -643,7 +643,7 @@ int cx88_audio_thread(void *data); | |||
643 | 643 | ||
644 | int cx8802_register_driver(struct cx8802_driver *drv); | 644 | int cx8802_register_driver(struct cx8802_driver *drv); |
645 | int cx8802_unregister_driver(struct cx8802_driver *drv); | 645 | int cx8802_unregister_driver(struct cx8802_driver *drv); |
646 | struct cx8802_dev * cx8802_get_device(struct inode *inode); | 646 | struct cx8802_dev *cx8802_get_device(int minor); |
647 | struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype); | 647 | struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype); |
648 | 648 | ||
649 | /* ----------------------------------------------------------- */ | 649 | /* ----------------------------------------------------------- */ |