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/usbvideo/usbvideo.c | |
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/usbvideo/usbvideo.c')
-rw-r--r-- | drivers/media/video/usbvideo/usbvideo.c | 18 |
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); | |||
41 | static void usbvideo_Disconnect(struct usb_interface *intf); | 41 | static void usbvideo_Disconnect(struct usb_interface *intf); |
42 | static void usbvideo_CameraRelease(struct uvd *uvd); | 42 | static void usbvideo_CameraRelease(struct uvd *uvd); |
43 | 43 | ||
44 | static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, | 44 | static int usbvideo_v4l_ioctl(struct file *file, |
45 | unsigned int cmd, unsigned long arg); | 45 | unsigned int cmd, unsigned long arg); |
46 | static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma); | 46 | static int usbvideo_v4l_mmap(struct file *file, struct vm_area_struct *vma); |
47 | static int usbvideo_v4l_open(struct inode *inode, struct file *file); | 47 | static int usbvideo_v4l_open(struct file *file); |
48 | static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf, | 48 | static 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); |
50 | static int usbvideo_v4l_close(struct inode *inode, struct file *file); | 50 | static int usbvideo_v4l_close(struct file *file); |
51 | 51 | ||
52 | static int usbvideo_StartDataPump(struct uvd *uvd); | 52 | static int usbvideo_StartDataPump(struct uvd *uvd); |
53 | static void usbvideo_StopDataPump(struct uvd *uvd); | 53 | static 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 | ||
945 | static const struct file_operations usbvideo_fops = { | 945 | static 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 | }; |
957 | static const struct video_device usbvideo_template = { | 953 | static 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 | */ |
1116 | static int usbvideo_v4l_open(struct inode *inode, struct file *file) | 1112 | static 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 | */ |
1236 | static int usbvideo_v4l_close(struct inode *inode, struct file *file) | 1232 | static 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 | ||
1504 | static int usbvideo_v4l_ioctl(struct inode *inode, struct file *file, | 1500 | static 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); |