aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvideo/usbvideo.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-12-30 04:58:20 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-02 14:11:12 -0500
commitbec43661b1dc0075b7445223ba775674133b164d (patch)
tree2a09ad5cc78799985e5cfb789f0a23db58e70499 /drivers/media/video/usbvideo/usbvideo.c
parentdfa9a5ae679ff2d23caa995d0f55a19abaf0596e (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/usbvideo/usbvideo.c')
-rw-r--r--drivers/media/video/usbvideo/usbvideo.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c
index 148a1f98c70f..9bf82430eb18 100644
--- a/drivers/media/video/usbvideo/usbvideo.c
+++ b/drivers/media/video/usbvideo/usbvideo.c
@@ -41,13 +41,13 @@ module_param(video_nr, int, 0);
41static void usbvideo_Disconnect(struct usb_interface *intf); 41static void usbvideo_Disconnect(struct usb_interface *intf);
42static void usbvideo_CameraRelease(struct uvd *uvd); 42static void usbvideo_CameraRelease(struct uvd *uvd);
43 43
44static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, 44static int usbvideo_v4l_ioctl(struct file *file,
45 unsigned int cmd, unsigned long arg); 45 unsigned int cmd, unsigned long arg);
46static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma); 46static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma);
47static int usbvideo_v4l_open(struct inode *inode, struct file *file); 47static int usbvideo_v4l_open(struct file *file);
48static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf, 48static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf,
49 size_t count, loff_t *ppos); 49 size_t count, loff_t *ppos);
50static int usbvideo_v4l_close(struct inode *inode, struct file *file); 50static int usbvideo_v4l_close(struct file *file);
51 51
52static int usbvideo_StartDataPump(struct uvd *uvd); 52static int usbvideo_StartDataPump(struct uvd *uvd);
53static void usbvideo_StopDataPump(struct uvd *uvd); 53static void usbvideo_StopDataPump(struct uvd *uvd);
@@ -942,17 +942,13 @@ static int usbvideo_find_struct(struct usbvideo *cams)
942 return rv; 942 return rv;
943} 943}
944 944
945static const struct file_operations usbvideo_fops = { 945static const struct v4l2_file_operations usbvideo_fops = {
946 .owner = THIS_MODULE, 946 .owner = THIS_MODULE,
947 .open = usbvideo_v4l_open, 947 .open = usbvideo_v4l_open,
948 .release =usbvideo_v4l_close, 948 .release =usbvideo_v4l_close,
949 .read = usbvideo_v4l_read, 949 .read = usbvideo_v4l_read,
950 .mmap = usbvideo_v4l_mmap, 950 .mmap = usbvideo_v4l_mmap,
951 .ioctl = usbvideo_v4l_ioctl, 951 .ioctl = usbvideo_v4l_ioctl,
952#ifdef CONFIG_COMPAT
953 .compat_ioctl = v4l_compat_ioctl32,
954#endif
955 .llseek = no_llseek,
956}; 952};
957static const struct video_device usbvideo_template = { 953static const struct video_device usbvideo_template = {
958 .fops = &usbvideo_fops, 954 .fops = &usbvideo_fops,
@@ -1113,7 +1109,7 @@ static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma)
1113 * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers. 1109 * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers.
1114 * 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT). 1110 * 24-May-2000 Corrected to prevent race condition (MOD_xxx_USE_COUNT).
1115 */ 1111 */
1116static int usbvideo_v4l_open(struct inode *inode, struct file *file) 1112static int usbvideo_v4l_open(struct file *file)
1117{ 1113{
1118 struct video_device *dev = video_devdata(file); 1114 struct video_device *dev = video_devdata(file);
1119 struct uvd *uvd = (struct uvd *) dev; 1115 struct uvd *uvd = (struct uvd *) dev;
@@ -1233,7 +1229,7 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
1233 * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers. 1229 * 27-Jan-2000 Used USBVIDEO_NUMSBUF as number of URB buffers.
1234 * 24-May-2000 Moved MOD_DEC_USE_COUNT outside of code that can sleep. 1230 * 24-May-2000 Moved MOD_DEC_USE_COUNT outside of code that can sleep.
1235 */ 1231 */
1236static int usbvideo_v4l_close(struct inode *inode, struct file *file) 1232static int usbvideo_v4l_close(struct file *file)
1237{ 1233{
1238 struct video_device *dev = file->private_data; 1234 struct video_device *dev = file->private_data;
1239 struct uvd *uvd = (struct uvd *) dev; 1235 struct uvd *uvd = (struct uvd *) dev;
@@ -1501,7 +1497,7 @@ static int usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1501 return 0; 1497 return 0;
1502} 1498}
1503 1499
1504static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, 1500static int usbvideo_v4l_ioctl(struct file *file,
1505 unsigned int cmd, unsigned long arg) 1501 unsigned int cmd, unsigned long arg)
1506{ 1502{
1507 return video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl); 1503 return video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl);