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/usbvision | |
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/usbvision')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 85661b1848fe..21456b862127 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -355,7 +355,7 @@ static void usbvision_remove_sysfs(struct video_device *vdev) | |||
355 | * then allocates buffers needed for video processing. | 355 | * then allocates buffers needed for video processing. |
356 | * | 356 | * |
357 | */ | 357 | */ |
358 | static int usbvision_v4l2_open(struct inode *inode, struct file *file) | 358 | static int usbvision_v4l2_open(struct file *file) |
359 | { | 359 | { |
360 | struct usb_usbvision *usbvision = video_drvdata(file); | 360 | struct usb_usbvision *usbvision = video_drvdata(file); |
361 | int errCode = 0; | 361 | int errCode = 0; |
@@ -432,7 +432,7 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file) | |||
432 | * allocated in usbvision_v4l2_open(). | 432 | * allocated in usbvision_v4l2_open(). |
433 | * | 433 | * |
434 | */ | 434 | */ |
435 | static int usbvision_v4l2_close(struct inode *inode, struct file *file) | 435 | static int usbvision_v4l2_close(struct file *file) |
436 | { | 436 | { |
437 | struct usb_usbvision *usbvision = video_drvdata(file); | 437 | struct usb_usbvision *usbvision = video_drvdata(file); |
438 | 438 | ||
@@ -1178,7 +1178,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma) | |||
1178 | * Here comes the stuff for radio on usbvision based devices | 1178 | * Here comes the stuff for radio on usbvision based devices |
1179 | * | 1179 | * |
1180 | */ | 1180 | */ |
1181 | static int usbvision_radio_open(struct inode *inode, struct file *file) | 1181 | static int usbvision_radio_open(struct file *file) |
1182 | { | 1182 | { |
1183 | struct usb_usbvision *usbvision = video_drvdata(file); | 1183 | struct usb_usbvision *usbvision = video_drvdata(file); |
1184 | int errCode = 0; | 1184 | int errCode = 0; |
@@ -1228,7 +1228,7 @@ out: | |||
1228 | } | 1228 | } |
1229 | 1229 | ||
1230 | 1230 | ||
1231 | static int usbvision_radio_close(struct inode *inode, struct file *file) | 1231 | static int usbvision_radio_close(struct file *file) |
1232 | { | 1232 | { |
1233 | struct usb_usbvision *usbvision = video_drvdata(file); | 1233 | struct usb_usbvision *usbvision = video_drvdata(file); |
1234 | int errCode = 0; | 1234 | int errCode = 0; |
@@ -1266,13 +1266,13 @@ static int usbvision_radio_close(struct inode *inode, struct file *file) | |||
1266 | * Here comes the stuff for vbi on usbvision based devices | 1266 | * Here comes the stuff for vbi on usbvision based devices |
1267 | * | 1267 | * |
1268 | */ | 1268 | */ |
1269 | static int usbvision_vbi_open(struct inode *inode, struct file *file) | 1269 | static int usbvision_vbi_open(struct file *file) |
1270 | { | 1270 | { |
1271 | /* TODO */ | 1271 | /* TODO */ |
1272 | return -ENODEV; | 1272 | return -ENODEV; |
1273 | } | 1273 | } |
1274 | 1274 | ||
1275 | static int usbvision_vbi_close(struct inode *inode, struct file *file) | 1275 | static int usbvision_vbi_close(struct file *file) |
1276 | { | 1276 | { |
1277 | /* TODO */ | 1277 | /* TODO */ |
1278 | return -ENODEV; | 1278 | return -ENODEV; |
@@ -1285,7 +1285,7 @@ static int usbvision_do_vbi_ioctl(struct file *file, | |||
1285 | return -ENOIOCTLCMD; | 1285 | return -ENOIOCTLCMD; |
1286 | } | 1286 | } |
1287 | 1287 | ||
1288 | static int usbvision_vbi_ioctl(struct inode *inode, struct file *file, | 1288 | static int usbvision_vbi_ioctl(struct file *file, |
1289 | unsigned int cmd, unsigned long arg) | 1289 | unsigned int cmd, unsigned long arg) |
1290 | { | 1290 | { |
1291 | return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl); | 1291 | return video_usercopy(file, cmd, arg, usbvision_do_vbi_ioctl); |
@@ -1297,16 +1297,14 @@ static int usbvision_vbi_ioctl(struct inode *inode, struct file *file, | |||
1297 | // | 1297 | // |
1298 | 1298 | ||
1299 | // Video template | 1299 | // Video template |
1300 | static const struct file_operations usbvision_fops = { | 1300 | static const struct v4l2_file_operations usbvision_fops = { |
1301 | .owner = THIS_MODULE, | 1301 | .owner = THIS_MODULE, |
1302 | .open = usbvision_v4l2_open, | 1302 | .open = usbvision_v4l2_open, |
1303 | .release = usbvision_v4l2_close, | 1303 | .release = usbvision_v4l2_close, |
1304 | .read = usbvision_v4l2_read, | 1304 | .read = usbvision_v4l2_read, |
1305 | .mmap = usbvision_v4l2_mmap, | 1305 | .mmap = usbvision_v4l2_mmap, |
1306 | .ioctl = video_ioctl2, | 1306 | .ioctl = video_ioctl2, |
1307 | .llseek = no_llseek, | ||
1308 | /* .poll = video_poll, */ | 1307 | /* .poll = video_poll, */ |
1309 | .compat_ioctl = v4l_compat_ioctl32, | ||
1310 | }; | 1308 | }; |
1311 | 1309 | ||
1312 | static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { | 1310 | static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { |
@@ -1355,13 +1353,11 @@ static struct video_device usbvision_video_template = { | |||
1355 | 1353 | ||
1356 | 1354 | ||
1357 | // Radio template | 1355 | // Radio template |
1358 | static const struct file_operations usbvision_radio_fops = { | 1356 | static const struct v4l2_file_operations usbvision_radio_fops = { |
1359 | .owner = THIS_MODULE, | 1357 | .owner = THIS_MODULE, |
1360 | .open = usbvision_radio_open, | 1358 | .open = usbvision_radio_open, |
1361 | .release = usbvision_radio_close, | 1359 | .release = usbvision_radio_close, |
1362 | .ioctl = video_ioctl2, | 1360 | .ioctl = video_ioctl2, |
1363 | .llseek = no_llseek, | ||
1364 | .compat_ioctl = v4l_compat_ioctl32, | ||
1365 | }; | 1361 | }; |
1366 | 1362 | ||
1367 | static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { | 1363 | static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { |
@@ -1392,13 +1388,11 @@ static struct video_device usbvision_radio_template = { | |||
1392 | }; | 1388 | }; |
1393 | 1389 | ||
1394 | // vbi template | 1390 | // vbi template |
1395 | static const struct file_operations usbvision_vbi_fops = { | 1391 | static const struct v4l2_file_operations usbvision_vbi_fops = { |
1396 | .owner = THIS_MODULE, | 1392 | .owner = THIS_MODULE, |
1397 | .open = usbvision_vbi_open, | 1393 | .open = usbvision_vbi_open, |
1398 | .release = usbvision_vbi_close, | 1394 | .release = usbvision_vbi_close, |
1399 | .ioctl = usbvision_vbi_ioctl, | 1395 | .ioctl = usbvision_vbi_ioctl, |
1400 | .llseek = no_llseek, | ||
1401 | .compat_ioctl = v4l_compat_ioctl32, | ||
1402 | }; | 1396 | }; |
1403 | 1397 | ||
1404 | static struct video_device usbvision_vbi_template= | 1398 | static struct video_device usbvision_vbi_template= |