aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/arv.c12
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c20
-rw-r--r--drivers/media/video/bw-qcam.c12
-rw-r--r--drivers/media/video/c-qcam.c12
-rw-r--r--drivers/media/video/cafe_ccic.c9
-rw-r--r--drivers/media/video/cpia.c12
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c12
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c6
-rw-r--r--drivers/media/video/cx18/cx18-fileops.h4
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c4
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.h2
-rw-r--r--drivers/media/video/cx18/cx18-streams.c13
-rw-r--r--drivers/media/video/cx23885/cx23885-417.c10
-rw-r--r--drivers/media/video/cx23885/cx23885-video.c14
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c13
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c3
-rw-r--r--drivers/media/video/cx88/cx88-video.c14
-rw-r--r--drivers/media/video/cx88/cx88.h2
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c3
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c16
-rw-r--r--drivers/media/video/em28xx/em28xx.h2
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c18
-rw-r--r--drivers/media/video/gspca/gspca.c12
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c4
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.h4
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c8
-rw-r--r--drivers/media/video/meye.c10
-rw-r--r--drivers/media/video/omap24xxcam.c9
-rw-r--r--drivers/media/video/ov511.c12
-rw-r--r--drivers/media/video/pms.c12
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c9
-rw-r--r--drivers/media/video/pwc/pwc-if.c18
-rw-r--r--drivers/media/video/s2255drv.c12
-rw-r--r--drivers/media/video/saa5246a.c9
-rw-r--r--drivers/media/video/saa5249.c12
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c9
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c14
-rw-r--r--drivers/media/video/se401.c12
-rw-r--r--drivers/media/video/sn9c102/sn9c102_core.c18
-rw-r--r--drivers/media/video/soc_camera.c7
-rw-r--r--drivers/media/video/stk-webcam.c10
-rw-r--r--drivers/media/video/stradis.c12
-rw-r--r--drivers/media/video/stv680.c12
-rw-r--r--drivers/media/video/usbvideo/usbvideo.c18
-rw-r--r--drivers/media/video/usbvideo/vicam.c12
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c26
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c10
-rw-r--r--drivers/media/video/uvc/uvcvideo.h2
-rw-r--r--drivers/media/video/v4l2-compat-ioctl32.c7
-rw-r--r--drivers/media/video/v4l2-dev.c25
-rw-r--r--drivers/media/video/v4l2-ioctl.c9
-rw-r--r--drivers/media/video/vino.c9
-rw-r--r--drivers/media/video/vivi.c12
-rw-r--r--drivers/media/video/w9966.c14
-rw-r--r--drivers/media/video/w9968cf.c32
-rw-r--r--drivers/media/video/zc0301/zc0301_core.c18
-rw-r--r--drivers/media/video/zoran/zoran_driver.c21
-rw-r--r--drivers/media/video/zr364xx.c7
59 files changed, 243 insertions, 419 deletions
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index 2ba6abd92b6f..f18fb7367e9a 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -539,7 +539,7 @@ static int ar_do_ioctl(struct file *file, unsigned int cmd, void *arg)
539 return 0; 539 return 0;
540} 540}
541 541
542static int ar_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 542static int ar_ioctl(struct file *file, unsigned int cmd,
543 unsigned long arg) 543 unsigned long arg)
544{ 544{
545 return video_usercopy(file, cmd, arg, ar_do_ioctl); 545 return video_usercopy(file, cmd, arg, ar_do_ioctl);
@@ -744,27 +744,23 @@ void ar_release(struct video_device *vfd)
744 ****************************************************************************/ 744 ****************************************************************************/
745static struct ar_device ardev; 745static struct ar_device ardev;
746 746
747static int ar_exclusive_open(struct inode *inode, struct file *file) 747static int ar_exclusive_open(struct file *file)
748{ 748{
749 return test_and_set_bit(0, &ardev.in_use) ? -EBUSY : 0; 749 return test_and_set_bit(0, &ardev.in_use) ? -EBUSY : 0;
750} 750}
751 751
752static int ar_exclusive_release(struct inode *inode, struct file *file) 752static int ar_exclusive_release(struct file *file)
753{ 753{
754 clear_bit(0, &ardev.in_use); 754 clear_bit(0, &ardev.in_use);
755 return 0; 755 return 0;
756} 756}
757 757
758static const struct file_operations ar_fops = { 758static const struct v4l2_file_operations ar_fops = {
759 .owner = THIS_MODULE, 759 .owner = THIS_MODULE,
760 .open = ar_exclusive_open, 760 .open = ar_exclusive_open,
761 .release = ar_exclusive_release, 761 .release = ar_exclusive_release,
762 .read = ar_read, 762 .read = ar_read,
763 .ioctl = ar_ioctl, 763 .ioctl = ar_ioctl,
764#ifdef CONFIG_COMPAT
765 .compat_ioctl = v4l_compat_ioctl32,
766#endif
767 .llseek = no_llseek,
768}; 764};
769 765
770static struct video_device ar_template = { 766static struct video_device ar_template = {
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 9ec4cec2e52d..ebcb8e5e9c4d 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3208,9 +3208,9 @@ err:
3208 return POLLERR; 3208 return POLLERR;
3209} 3209}
3210 3210
3211static int bttv_open(struct inode *inode, struct file *file) 3211static int bttv_open(struct file *file)
3212{ 3212{
3213 int minor = iminor(inode); 3213 int minor = video_devdata(file)->minor;
3214 struct bttv *btv = NULL; 3214 struct bttv *btv = NULL;
3215 struct bttv_fh *fh; 3215 struct bttv_fh *fh;
3216 enum v4l2_buf_type type = 0; 3216 enum v4l2_buf_type type = 0;
@@ -3291,7 +3291,7 @@ static int bttv_open(struct inode *inode, struct file *file)
3291 return 0; 3291 return 0;
3292} 3292}
3293 3293
3294static int bttv_release(struct inode *inode, struct file *file) 3294static int bttv_release(struct file *file)
3295{ 3295{
3296 struct bttv_fh *fh = file->private_data; 3296 struct bttv_fh *fh = file->private_data;
3297 struct bttv *btv = fh->btv; 3297 struct bttv *btv = fh->btv;
@@ -3346,14 +3346,12 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma)
3346 return videobuf_mmap_mapper(bttv_queue(fh),vma); 3346 return videobuf_mmap_mapper(bttv_queue(fh),vma);
3347} 3347}
3348 3348
3349static const struct file_operations bttv_fops = 3349static const struct v4l2_file_operations bttv_fops =
3350{ 3350{
3351 .owner = THIS_MODULE, 3351 .owner = THIS_MODULE,
3352 .open = bttv_open, 3352 .open = bttv_open,
3353 .release = bttv_release, 3353 .release = bttv_release,
3354 .ioctl = video_ioctl2, 3354 .ioctl = video_ioctl2,
3355 .compat_ioctl = v4l_compat_ioctl32,
3356 .llseek = no_llseek,
3357 .read = bttv_read, 3355 .read = bttv_read,
3358 .mmap = bttv_mmap, 3356 .mmap = bttv_mmap,
3359 .poll = bttv_poll, 3357 .poll = bttv_poll,
@@ -3422,9 +3420,9 @@ static struct video_device bttv_video_template = {
3422/* ----------------------------------------------------------------------- */ 3420/* ----------------------------------------------------------------------- */
3423/* radio interface */ 3421/* radio interface */
3424 3422
3425static int radio_open(struct inode *inode, struct file *file) 3423static int radio_open(struct file *file)
3426{ 3424{
3427 int minor = iminor(inode); 3425 int minor = video_devdata(file)->minor;
3428 struct bttv *btv = NULL; 3426 struct bttv *btv = NULL;
3429 struct bttv_fh *fh; 3427 struct bttv_fh *fh;
3430 unsigned int i; 3428 unsigned int i;
@@ -3467,7 +3465,7 @@ static int radio_open(struct inode *inode, struct file *file)
3467 return 0; 3465 return 0;
3468} 3466}
3469 3467
3470static int radio_release(struct inode *inode, struct file *file) 3468static int radio_release(struct file *file)
3471{ 3469{
3472 struct bttv_fh *fh = file->private_data; 3470 struct bttv_fh *fh = file->private_data;
3473 struct bttv *btv = fh->btv; 3471 struct bttv *btv = fh->btv;
@@ -3633,15 +3631,13 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
3633 return cmd.result; 3631 return cmd.result;
3634} 3632}
3635 3633
3636static const struct file_operations radio_fops = 3634static const struct v4l2_file_operations radio_fops =
3637{ 3635{
3638 .owner = THIS_MODULE, 3636 .owner = THIS_MODULE,
3639 .open = radio_open, 3637 .open = radio_open,
3640 .read = radio_read, 3638 .read = radio_read,
3641 .release = radio_release, 3639 .release = radio_release,
3642 .compat_ioctl = v4l_compat_ioctl32,
3643 .ioctl = video_ioctl2, 3640 .ioctl = video_ioctl2,
3644 .llseek = no_llseek,
3645 .poll = radio_poll, 3641 .poll = radio_poll,
3646}; 3642};
3647 3643
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index 17f80d03f38e..0b02be57b99c 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -863,7 +863,7 @@ static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
863 return 0; 863 return 0;
864} 864}
865 865
866static int qcam_ioctl(struct inode *inode, struct file *file, 866static int qcam_ioctl(struct file *file,
867 unsigned int cmd, unsigned long arg) 867 unsigned int cmd, unsigned long arg)
868{ 868{
869 return video_usercopy(file, cmd, arg, qcam_do_ioctl); 869 return video_usercopy(file, cmd, arg, qcam_do_ioctl);
@@ -893,7 +893,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
893 return len; 893 return len;
894} 894}
895 895
896static int qcam_exclusive_open(struct inode *inode, struct file *file) 896static int qcam_exclusive_open(struct file *file)
897{ 897{
898 struct video_device *dev = video_devdata(file); 898 struct video_device *dev = video_devdata(file);
899 struct qcam_device *qcam = (struct qcam_device *)dev; 899 struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -901,7 +901,7 @@ static int qcam_exclusive_open(struct inode *inode, struct file *file)
901 return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0; 901 return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0;
902} 902}
903 903
904static int qcam_exclusive_release(struct inode *inode, struct file *file) 904static int qcam_exclusive_release(struct file *file)
905{ 905{
906 struct video_device *dev = video_devdata(file); 906 struct video_device *dev = video_devdata(file);
907 struct qcam_device *qcam = (struct qcam_device *)dev; 907 struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -910,16 +910,12 @@ static int qcam_exclusive_release(struct inode *inode, struct file *file)
910 return 0; 910 return 0;
911} 911}
912 912
913static const struct file_operations qcam_fops = { 913static const struct v4l2_file_operations qcam_fops = {
914 .owner = THIS_MODULE, 914 .owner = THIS_MODULE,
915 .open = qcam_exclusive_open, 915 .open = qcam_exclusive_open,
916 .release = qcam_exclusive_release, 916 .release = qcam_exclusive_release,
917 .ioctl = qcam_ioctl, 917 .ioctl = qcam_ioctl,
918#ifdef CONFIG_COMPAT
919 .compat_ioctl = v4l_compat_ioctl32,
920#endif
921 .read = qcam_read, 918 .read = qcam_read,
922 .llseek = no_llseek,
923}; 919};
924static struct video_device qcam_template= 920static struct video_device qcam_template=
925{ 921{
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index 21c71eb085db..837c16df1f51 100644
--- a/drivers/media/video/c-qcam.c
+++ b/drivers/media/video/c-qcam.c
@@ -665,7 +665,7 @@ static int qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
665 return 0; 665 return 0;
666} 666}
667 667
668static int qcam_ioctl(struct inode *inode, struct file *file, 668static int qcam_ioctl(struct file *file,
669 unsigned int cmd, unsigned long arg) 669 unsigned int cmd, unsigned long arg)
670{ 670{
671 return video_usercopy(file, cmd, arg, qcam_do_ioctl); 671 return video_usercopy(file, cmd, arg, qcam_do_ioctl);
@@ -687,7 +687,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf,
687 return len; 687 return len;
688} 688}
689 689
690static int qcam_exclusive_open(struct inode *inode, struct file *file) 690static int qcam_exclusive_open(struct file *file)
691{ 691{
692 struct video_device *dev = video_devdata(file); 692 struct video_device *dev = video_devdata(file);
693 struct qcam_device *qcam = (struct qcam_device *)dev; 693 struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -695,7 +695,7 @@ static int qcam_exclusive_open(struct inode *inode, struct file *file)
695 return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0; 695 return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0;
696} 696}
697 697
698static int qcam_exclusive_release(struct inode *inode, struct file *file) 698static int qcam_exclusive_release(struct file *file)
699{ 699{
700 struct video_device *dev = video_devdata(file); 700 struct video_device *dev = video_devdata(file);
701 struct qcam_device *qcam = (struct qcam_device *)dev; 701 struct qcam_device *qcam = (struct qcam_device *)dev;
@@ -705,16 +705,12 @@ static int qcam_exclusive_release(struct inode *inode, struct file *file)
705} 705}
706 706
707/* video device template */ 707/* video device template */
708static const struct file_operations qcam_fops = { 708static const struct v4l2_file_operations qcam_fops = {
709 .owner = THIS_MODULE, 709 .owner = THIS_MODULE,
710 .open = qcam_exclusive_open, 710 .open = qcam_exclusive_open,
711 .release = qcam_exclusive_release, 711 .release = qcam_exclusive_release,
712 .ioctl = qcam_ioctl, 712 .ioctl = qcam_ioctl,
713#ifdef CONFIG_COMPAT
714 .compat_ioctl = v4l_compat_ioctl32,
715#endif
716 .read = qcam_read, 713 .read = qcam_read,
717 .llseek = no_llseek,
718}; 714};
719 715
720static struct video_device qcam_template= 716static struct video_device qcam_template=
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 1740b9ebdcef..476171cf5001 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -1472,11 +1472,11 @@ static int cafe_v4l_mmap(struct file *filp, struct vm_area_struct *vma)
1472 1472
1473 1473
1474 1474
1475static int cafe_v4l_open(struct inode *inode, struct file *filp) 1475static int cafe_v4l_open(struct file *filp)
1476{ 1476{
1477 struct cafe_camera *cam; 1477 struct cafe_camera *cam;
1478 1478
1479 cam = cafe_find_dev(iminor(inode)); 1479 cam = cafe_find_dev(video_devdata(filp)->minor);
1480 if (cam == NULL) 1480 if (cam == NULL)
1481 return -ENODEV; 1481 return -ENODEV;
1482 filp->private_data = cam; 1482 filp->private_data = cam;
@@ -1494,7 +1494,7 @@ static int cafe_v4l_open(struct inode *inode, struct file *filp)
1494} 1494}
1495 1495
1496 1496
1497static int cafe_v4l_release(struct inode *inode, struct file *filp) 1497static int cafe_v4l_release(struct file *filp)
1498{ 1498{
1499 struct cafe_camera *cam = filp->private_data; 1499 struct cafe_camera *cam = filp->private_data;
1500 1500
@@ -1759,7 +1759,7 @@ static void cafe_v4l_dev_release(struct video_device *vd)
1759 * clone it for specific real devices. 1759 * clone it for specific real devices.
1760 */ 1760 */
1761 1761
1762static const struct file_operations cafe_v4l_fops = { 1762static const struct v4l2_file_operations cafe_v4l_fops = {
1763 .owner = THIS_MODULE, 1763 .owner = THIS_MODULE,
1764 .open = cafe_v4l_open, 1764 .open = cafe_v4l_open,
1765 .release = cafe_v4l_release, 1765 .release = cafe_v4l_release,
@@ -1767,7 +1767,6 @@ static const struct file_operations cafe_v4l_fops = {
1767 .poll = cafe_v4l_poll, 1767 .poll = cafe_v4l_poll,
1768 .mmap = cafe_v4l_mmap, 1768 .mmap = cafe_v4l_mmap,
1769 .ioctl = video_ioctl2, 1769 .ioctl = video_ioctl2,
1770 .llseek = no_llseek,
1771}; 1770};
1772 1771
1773static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = { 1772static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = {
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 028a400d2453..9925ec0ab29d 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -3148,7 +3148,7 @@ static void put_cam(struct cpia_camera_ops* ops)
3148} 3148}
3149 3149
3150/* ------------------------- V4L interface --------------------- */ 3150/* ------------------------- V4L interface --------------------- */
3151static int cpia_open(struct inode *inode, struct file *file) 3151static int cpia_open(struct file *file)
3152{ 3152{
3153 struct video_device *dev = video_devdata(file); 3153 struct video_device *dev = video_devdata(file);
3154 struct cam_data *cam = video_get_drvdata(dev); 3154 struct cam_data *cam = video_get_drvdata(dev);
@@ -3225,7 +3225,7 @@ static int cpia_open(struct inode *inode, struct file *file)
3225 return err; 3225 return err;
3226} 3226}
3227 3227
3228static int cpia_close(struct inode *inode, struct file *file) 3228static int cpia_close(struct file *file)
3229{ 3229{
3230 struct video_device *dev = file->private_data; 3230 struct video_device *dev = file->private_data;
3231 struct cam_data *cam = video_get_drvdata(dev); 3231 struct cam_data *cam = video_get_drvdata(dev);
@@ -3720,7 +3720,7 @@ static int cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg)
3720 return retval; 3720 return retval;
3721} 3721}
3722 3722
3723static int cpia_ioctl(struct inode *inode, struct file *file, 3723static int cpia_ioctl(struct file *file,
3724 unsigned int cmd, unsigned long arg) 3724 unsigned int cmd, unsigned long arg)
3725{ 3725{
3726 return video_usercopy(file, cmd, arg, cpia_do_ioctl); 3726 return video_usercopy(file, cmd, arg, cpia_do_ioctl);
@@ -3780,17 +3780,13 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
3780 return 0; 3780 return 0;
3781} 3781}
3782 3782
3783static const struct file_operations cpia_fops = { 3783static const struct v4l2_file_operations cpia_fops = {
3784 .owner = THIS_MODULE, 3784 .owner = THIS_MODULE,
3785 .open = cpia_open, 3785 .open = cpia_open,
3786 .release = cpia_close, 3786 .release = cpia_close,
3787 .read = cpia_read, 3787 .read = cpia_read,
3788 .mmap = cpia_mmap, 3788 .mmap = cpia_mmap,
3789 .ioctl = cpia_ioctl, 3789 .ioctl = cpia_ioctl,
3790#ifdef CONFIG_COMPAT
3791 .compat_ioctl = v4l_compat_ioctl32,
3792#endif
3793 .llseek = no_llseek,
3794}; 3790};
3795 3791
3796static struct video_device cpia_template = { 3792static struct video_device cpia_template = {
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index 3c2d7eac1197..91870cc9c445 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -239,7 +239,7 @@ static struct v4l2_queryctrl controls[] = {
239 * cpia2_open 239 * cpia2_open
240 * 240 *
241 *****************************************************************************/ 241 *****************************************************************************/
242static int cpia2_open(struct inode *inode, struct file *file) 242static int cpia2_open(struct file *file)
243{ 243{
244 struct camera_data *cam = video_drvdata(file); 244 struct camera_data *cam = video_drvdata(file);
245 int retval = 0; 245 int retval = 0;
@@ -302,7 +302,7 @@ err_return:
302 * cpia2_close 302 * cpia2_close
303 * 303 *
304 *****************************************************************************/ 304 *****************************************************************************/
305static int cpia2_close(struct inode *inode, struct file *file) 305static int cpia2_close(struct file *file)
306{ 306{
307 struct video_device *dev = video_devdata(file); 307 struct video_device *dev = video_devdata(file);
308 struct camera_data *cam = video_get_drvdata(dev); 308 struct camera_data *cam = video_get_drvdata(dev);
@@ -1841,7 +1841,7 @@ static int cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1841 return retval; 1841 return retval;
1842} 1842}
1843 1843
1844static int cpia2_ioctl(struct inode *inode, struct file *file, 1844static int cpia2_ioctl(struct file *file,
1845 unsigned int cmd, unsigned long arg) 1845 unsigned int cmd, unsigned long arg)
1846{ 1846{
1847 return video_usercopy(file, cmd, arg, cpia2_do_ioctl); 1847 return video_usercopy(file, cmd, arg, cpia2_do_ioctl);
@@ -1912,17 +1912,13 @@ static void reset_camera_struct_v4l(struct camera_data *cam)
1912/*** 1912/***
1913 * The v4l video device structure initialized for this device 1913 * The v4l video device structure initialized for this device
1914 ***/ 1914 ***/
1915static const struct file_operations fops_template = { 1915static const struct v4l2_file_operations fops_template = {
1916 .owner = THIS_MODULE, 1916 .owner = THIS_MODULE,
1917 .open = cpia2_open, 1917 .open = cpia2_open,
1918 .release = cpia2_close, 1918 .release = cpia2_close,
1919 .read = cpia2_v4l_read, 1919 .read = cpia2_v4l_read,
1920 .poll = cpia2_v4l_poll, 1920 .poll = cpia2_v4l_poll,
1921 .ioctl = cpia2_ioctl, 1921 .ioctl = cpia2_ioctl,
1922 .llseek = no_llseek,
1923#ifdef CONFIG_COMPAT
1924 .compat_ioctl = v4l_compat_ioctl32,
1925#endif
1926 .mmap = cpia2_mmap, 1922 .mmap = cpia2_mmap,
1927}; 1923};
1928 1924
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 425271a29517..055f6e004b2d 100644
--- a/drivers/media/video/cx18/cx18-fileops.c
+++ b/drivers/media/video/cx18/cx18-fileops.c
@@ -552,7 +552,7 @@ void cx18_stop_capture(struct cx18_open_id *id, int gop_end)
552 } 552 }
553} 553}
554 554
555int cx18_v4l2_close(struct inode *inode, struct file *filp) 555int cx18_v4l2_close(struct file *filp)
556{ 556{
557 struct cx18_open_id *id = filp->private_data; 557 struct cx18_open_id *id = filp->private_data;
558 struct cx18 *cx = id->cx; 558 struct cx18 *cx = id->cx;
@@ -650,12 +650,12 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)
650 return 0; 650 return 0;
651} 651}
652 652
653int cx18_v4l2_open(struct inode *inode, struct file *filp) 653int cx18_v4l2_open(struct file *filp)
654{ 654{
655 int res, x, y = 0; 655 int res, x, y = 0;
656 struct cx18 *cx = NULL; 656 struct cx18 *cx = NULL;
657 struct cx18_stream *s = NULL; 657 struct cx18_stream *s = NULL;
658 int minor = iminor(inode); 658 int minor = video_devdata(filp)->minor;
659 659
660 /* Find which card this open was on */ 660 /* Find which card this open was on */
661 spin_lock(&cx18_cards_lock); 661 spin_lock(&cx18_cards_lock);
diff --git a/drivers/media/video/cx18/cx18-fileops.h b/drivers/media/video/cx18/cx18-fileops.h
index 46da0282fc7d..92e2d5dab936 100644
--- a/drivers/media/video/cx18/cx18-fileops.h
+++ b/drivers/media/video/cx18/cx18-fileops.h
@@ -22,12 +22,12 @@
22 */ 22 */
23 23
24/* Testing/Debugging */ 24/* Testing/Debugging */
25int cx18_v4l2_open(struct inode *inode, struct file *filp); 25int cx18_v4l2_open(struct file *filp);
26ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count, 26ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count,
27 loff_t *pos); 27 loff_t *pos);
28ssize_t cx18_v4l2_write(struct file *filp, const char __user *buf, size_t count, 28ssize_t cx18_v4l2_write(struct file *filp, const char __user *buf, size_t count,
29 loff_t *pos); 29 loff_t *pos);
30int cx18_v4l2_close(struct inode *inode, struct file *filp); 30int cx18_v4l2_close(struct file *filp);
31unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait); 31unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait);
32int cx18_start_capture(struct cx18_open_id *id); 32int cx18_start_capture(struct cx18_open_id *id);
33void cx18_stop_capture(struct cx18_open_id *id, int gop_end); 33void cx18_stop_capture(struct cx18_open_id *id, int gop_end);
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index e6087486f889..5023075506fb 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -783,7 +783,7 @@ static int cx18_default(struct file *file, void *fh, int cmd, void *arg)
783 return 0; 783 return 0;
784} 784}
785 785
786int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 786int cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
787 unsigned long arg) 787 unsigned long arg)
788{ 788{
789 struct video_device *vfd = video_devdata(filp); 789 struct video_device *vfd = video_devdata(filp);
@@ -795,7 +795,7 @@ int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
795 795
796 if (cx18_debug & CX18_DBGFLG_IOCTL) 796 if (cx18_debug & CX18_DBGFLG_IOCTL)
797 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; 797 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
798 res = video_ioctl2(inode, filp, cmd, arg); 798 res = video_ioctl2(filp, cmd, arg);
799 vfd->debug = 0; 799 vfd->debug = 0;
800 mutex_unlock(&cx->serialize_lock); 800 mutex_unlock(&cx->serialize_lock);
801 return res; 801 return res;
diff --git a/drivers/media/video/cx18/cx18-ioctl.h b/drivers/media/video/cx18/cx18-ioctl.h
index 08fe24e9510e..50b8d6056cdf 100644
--- a/drivers/media/video/cx18/cx18-ioctl.h
+++ b/drivers/media/video/cx18/cx18-ioctl.h
@@ -29,5 +29,5 @@ void cx18_set_funcs(struct video_device *vdev);
29int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std); 29int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std);
30int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf); 30int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf);
31int cx18_s_input(struct file *file, void *fh, unsigned int inp); 31int cx18_s_input(struct file *file, void *fh, unsigned int inp);
32int cx18_v4l2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, 32int cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
33 unsigned long arg); 33 unsigned long arg);
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index 63c336c95ff5..89c1ec94f335 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -37,13 +37,12 @@
37 37
38#define CX18_DSP0_INTERRUPT_MASK 0xd0004C 38#define CX18_DSP0_INTERRUPT_MASK 0xd0004C
39 39
40static struct file_operations cx18_v4l2_enc_fops = { 40static struct v4l2_file_operations cx18_v4l2_enc_fops = {
41 .owner = THIS_MODULE, 41 .owner = THIS_MODULE,
42 .read = cx18_v4l2_read, 42 .read = cx18_v4l2_read,
43 .open = cx18_v4l2_open, 43 .open = cx18_v4l2_open,
44 /* FIXME change to video_ioctl2 if serialization lock can be removed */ 44 /* FIXME change to video_ioctl2 if serialization lock can be removed */
45 .ioctl = cx18_v4l2_ioctl, 45 .ioctl = cx18_v4l2_ioctl,
46 .compat_ioctl = v4l_compat_ioctl32,
47 .release = cx18_v4l2_close, 46 .release = cx18_v4l2_close,
48 .poll = cx18_v4l2_enc_poll, 47 .poll = cx18_v4l2_enc_poll,
49}; 48};
@@ -61,49 +60,41 @@ static struct {
61 int num_offset; 60 int num_offset;
62 int dma; 61 int dma;
63 enum v4l2_buf_type buf_type; 62 enum v4l2_buf_type buf_type;
64 struct file_operations *fops;
65} cx18_stream_info[] = { 63} cx18_stream_info[] = {
66 { /* CX18_ENC_STREAM_TYPE_MPG */ 64 { /* CX18_ENC_STREAM_TYPE_MPG */
67 "encoder MPEG", 65 "encoder MPEG",
68 VFL_TYPE_GRABBER, 0, 66 VFL_TYPE_GRABBER, 0,
69 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 67 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
70 &cx18_v4l2_enc_fops
71 }, 68 },
72 { /* CX18_ENC_STREAM_TYPE_TS */ 69 { /* CX18_ENC_STREAM_TYPE_TS */
73 "TS", 70 "TS",
74 VFL_TYPE_GRABBER, -1, 71 VFL_TYPE_GRABBER, -1,
75 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 72 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
76 &cx18_v4l2_enc_fops
77 }, 73 },
78 { /* CX18_ENC_STREAM_TYPE_YUV */ 74 { /* CX18_ENC_STREAM_TYPE_YUV */
79 "encoder YUV", 75 "encoder YUV",
80 VFL_TYPE_GRABBER, CX18_V4L2_ENC_YUV_OFFSET, 76 VFL_TYPE_GRABBER, CX18_V4L2_ENC_YUV_OFFSET,
81 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 77 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
82 &cx18_v4l2_enc_fops
83 }, 78 },
84 { /* CX18_ENC_STREAM_TYPE_VBI */ 79 { /* CX18_ENC_STREAM_TYPE_VBI */
85 "encoder VBI", 80 "encoder VBI",
86 VFL_TYPE_VBI, 0, 81 VFL_TYPE_VBI, 0,
87 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VBI_CAPTURE, 82 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VBI_CAPTURE,
88 &cx18_v4l2_enc_fops
89 }, 83 },
90 { /* CX18_ENC_STREAM_TYPE_PCM */ 84 { /* CX18_ENC_STREAM_TYPE_PCM */
91 "encoder PCM audio", 85 "encoder PCM audio",
92 VFL_TYPE_GRABBER, CX18_V4L2_ENC_PCM_OFFSET, 86 VFL_TYPE_GRABBER, CX18_V4L2_ENC_PCM_OFFSET,
93 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_PRIVATE, 87 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_PRIVATE,
94 &cx18_v4l2_enc_fops
95 }, 88 },
96 { /* CX18_ENC_STREAM_TYPE_IDX */ 89 { /* CX18_ENC_STREAM_TYPE_IDX */
97 "encoder IDX", 90 "encoder IDX",
98 VFL_TYPE_GRABBER, -1, 91 VFL_TYPE_GRABBER, -1,
99 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE, 92 PCI_DMA_FROMDEVICE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
100 &cx18_v4l2_enc_fops
101 }, 93 },
102 { /* CX18_ENC_STREAM_TYPE_RAD */ 94 { /* CX18_ENC_STREAM_TYPE_RAD */
103 "encoder radio", 95 "encoder radio",
104 VFL_TYPE_RADIO, 0, 96 VFL_TYPE_RADIO, 0,
105 PCI_DMA_NONE, V4L2_BUF_TYPE_PRIVATE, 97 PCI_DMA_NONE, V4L2_BUF_TYPE_PRIVATE,
106 &cx18_v4l2_enc_fops
107 }, 98 },
108}; 99};
109 100
@@ -184,7 +175,7 @@ static int cx18_prep_dev(struct cx18 *cx, int type)
184 175
185 s->v4l2dev->num = num; 176 s->v4l2dev->num = num;
186 s->v4l2dev->parent = &cx->dev->dev; 177 s->v4l2dev->parent = &cx->dev->dev;
187 s->v4l2dev->fops = cx18_stream_info[type].fops; 178 s->v4l2dev->fops = &cx18_v4l2_enc_fops;
188 s->v4l2dev->release = video_device_release; 179 s->v4l2dev->release = video_device_release;
189 s->v4l2dev->tvnorms = V4L2_STD_ALL; 180 s->v4l2dev->tvnorms = V4L2_STD_ALL;
190 cx18_set_funcs(s->v4l2dev); 181 cx18_set_funcs(s->v4l2dev);
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
1576static int mpeg_open(struct inode *inode, struct file *file) 1576static 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
1620static int mpeg_release(struct inode *inode, struct file *file) 1620static 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
1697static struct file_operations mpeg_fops = { 1697static 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
1708static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { 1706static 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
721static int video_open(struct inode *inode, struct file *file) 721static 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
837static int video_release(struct inode *inode, struct file *file) 837static 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
1425static const struct file_operations video_fops = { 1425static 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
1437static const struct v4l2_ioctl_ops video_ioctl_ops = { 1435static 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
1482static const struct file_operations radio_fops = { 1480static 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
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
1052static int mpeg_open(struct inode *inode, struct file *file) 1052static 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
1117static int mpeg_release(struct inode *inode, struct file *file) 1117static 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
1181static const struct file_operations mpeg_fops = 1181static 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
1193static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { 1192static 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)
581struct cx8802_dev * cx8802_get_device(struct inode *inode) 581struct 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
760static int video_open(struct inode *inode, struct file *file) 760static 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
907static int video_release(struct inode *inode, struct file *file) 907static 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
1696static const struct file_operations video_fops = 1696static 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
1709static const struct v4l2_ioctl_ops video_ioctl_ops = { 1707static 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
1755static const struct file_operations radio_fops = 1753static 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
1765static const struct v4l2_ioctl_ops radio_ioctl_ops = { 1761static 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
644int cx8802_register_driver(struct cx8802_driver *drv); 644int cx8802_register_driver(struct cx8802_driver *drv);
645int cx8802_unregister_driver(struct cx8802_driver *drv); 645int cx8802_unregister_driver(struct cx8802_driver *drv);
646struct cx8802_dev * cx8802_get_device(struct inode *inode); 646struct cx8802_dev *cx8802_get_device(int minor);
647struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype); 647struct cx8802_driver * cx8802_get_driver(struct cx8802_dev *dev, enum cx88_board_type btype);
648 648
649/* ----------------------------------------------------------- */ 649/* ----------------------------------------------------------- */
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index f8504518586a..819cceaa6ef4 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -1000,12 +1000,11 @@ void em28xx_wake_i2c(struct em28xx *dev)
1000static LIST_HEAD(em28xx_devlist); 1000static LIST_HEAD(em28xx_devlist);
1001static DEFINE_MUTEX(em28xx_devlist_mutex); 1001static DEFINE_MUTEX(em28xx_devlist_mutex);
1002 1002
1003struct em28xx *em28xx_get_device(struct inode *inode, 1003struct em28xx *em28xx_get_device(int minor,
1004 enum v4l2_buf_type *fh_type, 1004 enum v4l2_buf_type *fh_type,
1005 int *has_radio) 1005 int *has_radio)
1006{ 1006{
1007 struct em28xx *h, *dev = NULL; 1007 struct em28xx *h, *dev = NULL;
1008 int minor = iminor(inode);
1009 1008
1010 *fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1009 *fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
1011 *has_radio = 0; 1010 *has_radio = 0;
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 53527536481e..9cb7c64a88fa 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1582,15 +1582,15 @@ static int radio_queryctrl(struct file *file, void *priv,
1582 * em28xx_v4l2_open() 1582 * em28xx_v4l2_open()
1583 * inits the device and starts isoc transfer 1583 * inits the device and starts isoc transfer
1584 */ 1584 */
1585static int em28xx_v4l2_open(struct inode *inode, struct file *filp) 1585static int em28xx_v4l2_open(struct file *filp)
1586{ 1586{
1587 int minor = iminor(inode); 1587 int minor = video_devdata(filp)->minor;
1588 int errCode = 0, radio; 1588 int errCode = 0, radio;
1589 struct em28xx *dev; 1589 struct em28xx *dev;
1590 enum v4l2_buf_type fh_type; 1590 enum v4l2_buf_type fh_type;
1591 struct em28xx_fh *fh; 1591 struct em28xx_fh *fh;
1592 1592
1593 dev = em28xx_get_device(inode, &fh_type, &radio); 1593 dev = em28xx_get_device(minor, &fh_type, &radio);
1594 1594
1595 if (NULL == dev) 1595 if (NULL == dev)
1596 return -ENODEV; 1596 return -ENODEV;
@@ -1686,7 +1686,7 @@ void em28xx_release_analog_resources(struct em28xx *dev)
1686 * stops streaming and deallocates all resources allocated by the v4l2 1686 * stops streaming and deallocates all resources allocated by the v4l2
1687 * calls and ioctls 1687 * calls and ioctls
1688 */ 1688 */
1689static int em28xx_v4l2_close(struct inode *inode, struct file *filp) 1689static int em28xx_v4l2_close(struct file *filp)
1690{ 1690{
1691 struct em28xx_fh *fh = filp->private_data; 1691 struct em28xx_fh *fh = filp->private_data;
1692 struct em28xx *dev = fh->dev; 1692 struct em28xx *dev = fh->dev;
@@ -1826,7 +1826,7 @@ static int em28xx_v4l2_mmap(struct file *filp, struct vm_area_struct *vma)
1826 return rc; 1826 return rc;
1827} 1827}
1828 1828
1829static const struct file_operations em28xx_v4l_fops = { 1829static const struct v4l2_file_operations em28xx_v4l_fops = {
1830 .owner = THIS_MODULE, 1830 .owner = THIS_MODULE,
1831 .open = em28xx_v4l2_open, 1831 .open = em28xx_v4l2_open,
1832 .release = em28xx_v4l2_close, 1832 .release = em28xx_v4l2_close,
@@ -1834,8 +1834,6 @@ static const struct file_operations em28xx_v4l_fops = {
1834 .poll = em28xx_v4l2_poll, 1834 .poll = em28xx_v4l2_poll,
1835 .mmap = em28xx_v4l2_mmap, 1835 .mmap = em28xx_v4l2_mmap,
1836 .ioctl = video_ioctl2, 1836 .ioctl = video_ioctl2,
1837 .llseek = no_llseek,
1838 .compat_ioctl = v4l_compat_ioctl32,
1839}; 1837};
1840 1838
1841static const struct v4l2_ioctl_ops video_ioctl_ops = { 1839static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -1890,13 +1888,11 @@ static const struct video_device em28xx_video_template = {
1890 .current_norm = V4L2_STD_PAL, 1888 .current_norm = V4L2_STD_PAL,
1891}; 1889};
1892 1890
1893static const struct file_operations radio_fops = { 1891static const struct v4l2_file_operations radio_fops = {
1894 .owner = THIS_MODULE, 1892 .owner = THIS_MODULE,
1895 .open = em28xx_v4l2_open, 1893 .open = em28xx_v4l2_open,
1896 .release = em28xx_v4l2_close, 1894 .release = em28xx_v4l2_close,
1897 .ioctl = video_ioctl2, 1895 .ioctl = video_ioctl2,
1898 .compat_ioctl = v4l_compat_ioctl32,
1899 .llseek = no_llseek,
1900}; 1896};
1901 1897
1902static const struct v4l2_ioctl_ops radio_ioctl_ops = { 1898static const struct v4l2_ioctl_ops radio_ioctl_ops = {
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index b5eddc26388e..afc5f6d17e0f 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -583,7 +583,7 @@ int em28xx_gpio_set(struct em28xx *dev, struct em28xx_reg_seq *gpio);
583void em28xx_wake_i2c(struct em28xx *dev); 583void em28xx_wake_i2c(struct em28xx *dev);
584void em28xx_remove_from_devlist(struct em28xx *dev); 584void em28xx_remove_from_devlist(struct em28xx *dev);
585void em28xx_add_into_devlist(struct em28xx *dev); 585void em28xx_add_into_devlist(struct em28xx *dev);
586struct em28xx *em28xx_get_device(struct inode *inode, 586struct em28xx *em28xx_get_device(int minor,
587 enum v4l2_buf_type *fh_type, 587 enum v4l2_buf_type *fh_type,
588 int *has_radio); 588 int *has_radio);
589int em28xx_register_extension(struct em28xx_ops *dev); 589int em28xx_register_extension(struct em28xx_ops *dev);
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index 83c07112c59d..3aeb8791a5bd 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -1206,7 +1206,7 @@ static void et61x251_release_resources(struct kref *kref)
1206} 1206}
1207 1207
1208 1208
1209static int et61x251_open(struct inode* inode, struct file* filp) 1209static int et61x251_open(struct file *filp)
1210{ 1210{
1211 struct et61x251_device* cam; 1211 struct et61x251_device* cam;
1212 int err = 0; 1212 int err = 0;
@@ -1291,7 +1291,7 @@ out:
1291} 1291}
1292 1292
1293 1293
1294static int et61x251_release(struct inode* inode, struct file* filp) 1294static int et61x251_release(struct file *filp)
1295{ 1295{
1296 struct et61x251_device* cam; 1296 struct et61x251_device* cam;
1297 1297
@@ -2392,8 +2392,8 @@ et61x251_vidioc_s_parm(struct et61x251_device* cam, void __user * arg)
2392} 2392}
2393 2393
2394 2394
2395static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp, 2395static int et61x251_ioctl_v4l2(struct file *filp,
2396 unsigned int cmd, void __user * arg) 2396 unsigned int cmd, void __user *arg)
2397{ 2397{
2398 struct et61x251_device *cam = video_drvdata(filp); 2398 struct et61x251_device *cam = video_drvdata(filp);
2399 2399
@@ -2487,7 +2487,7 @@ static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
2487} 2487}
2488 2488
2489 2489
2490static int et61x251_ioctl(struct inode* inode, struct file* filp, 2490static int et61x251_ioctl(struct file *filp,
2491 unsigned int cmd, unsigned long arg) 2491 unsigned int cmd, unsigned long arg)
2492{ 2492{
2493 struct et61x251_device *cam = video_drvdata(filp); 2493 struct et61x251_device *cam = video_drvdata(filp);
@@ -2511,7 +2511,7 @@ static int et61x251_ioctl(struct inode* inode, struct file* filp,
2511 2511
2512 V4LDBG(3, "et61x251", cmd); 2512 V4LDBG(3, "et61x251", cmd);
2513 2513
2514 err = et61x251_ioctl_v4l2(inode, filp, cmd, (void __user *)arg); 2514 err = et61x251_ioctl_v4l2(filp, cmd, (void __user *)arg);
2515 2515
2516 mutex_unlock(&cam->fileop_mutex); 2516 mutex_unlock(&cam->fileop_mutex);
2517 2517
@@ -2519,18 +2519,14 @@ static int et61x251_ioctl(struct inode* inode, struct file* filp,
2519} 2519}
2520 2520
2521 2521
2522static const struct file_operations et61x251_fops = { 2522static const struct v4l2_file_operations et61x251_fops = {
2523 .owner = THIS_MODULE, 2523 .owner = THIS_MODULE,
2524 .open = et61x251_open, 2524 .open = et61x251_open,
2525 .release = et61x251_release, 2525 .release = et61x251_release,
2526 .ioctl = et61x251_ioctl, 2526 .ioctl = et61x251_ioctl,
2527#ifdef CONFIG_COMPAT
2528 .compat_ioctl = v4l_compat_ioctl32,
2529#endif
2530 .read = et61x251_read, 2527 .read = et61x251_read,
2531 .poll = et61x251_poll, 2528 .poll = et61x251_poll,
2532 .mmap = et61x251_mmap, 2529 .mmap = et61x251_mmap,
2533 .llseek = no_llseek,
2534}; 2530};
2535 2531
2536/*****************************************************************************/ 2532/*****************************************************************************/
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 8b9f3bde5740..5e36b9a4ae3e 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -875,7 +875,7 @@ static void gspca_release(struct video_device *vfd)
875 kfree(gspca_dev); 875 kfree(gspca_dev);
876} 876}
877 877
878static int dev_open(struct inode *inode, struct file *file) 878static int dev_open(struct file *file)
879{ 879{
880 struct gspca_dev *gspca_dev; 880 struct gspca_dev *gspca_dev;
881 int ret; 881 int ret;
@@ -922,7 +922,7 @@ out:
922 return ret; 922 return ret;
923} 923}
924 924
925static int dev_close(struct inode *inode, struct file *file) 925static int dev_close(struct file *file)
926{ 926{
927 struct gspca_dev *gspca_dev = file->private_data; 927 struct gspca_dev *gspca_dev = file->private_data;
928 928
@@ -1802,17 +1802,13 @@ out:
1802 return ret; 1802 return ret;
1803} 1803}
1804 1804
1805static struct file_operations dev_fops = { 1805static struct v4l2_file_operations dev_fops = {
1806 .owner = THIS_MODULE, 1806 .owner = THIS_MODULE,
1807 .open = dev_open, 1807 .open = dev_open,
1808 .release = dev_close, 1808 .release = dev_close,
1809 .read = dev_read, 1809 .read = dev_read,
1810 .mmap = dev_mmap, 1810 .mmap = dev_mmap,
1811 .unlocked_ioctl = __video_ioctl2, 1811 .unlocked_ioctl = video_ioctl2,
1812#ifdef CONFIG_COMPAT
1813 .compat_ioctl = v4l_compat_ioctl32,
1814#endif
1815 .llseek = no_llseek,
1816 .poll = dev_poll, 1812 .poll = dev_poll,
1817}; 1813};
1818 1814
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index 5eb587592e9d..d594bc29f07f 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -831,7 +831,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts)
831 ivtv_release_stream(s); 831 ivtv_release_stream(s);
832} 832}
833 833
834int ivtv_v4l2_close(struct inode *inode, struct file *filp) 834int ivtv_v4l2_close(struct file *filp)
835{ 835{
836 struct ivtv_open_id *id = filp->private_data; 836 struct ivtv_open_id *id = filp->private_data;
837 struct ivtv *itv = id->itv; 837 struct ivtv *itv = id->itv;
@@ -978,7 +978,7 @@ static int ivtv_serialized_open(struct ivtv_stream *s, struct file *filp)
978 return 0; 978 return 0;
979} 979}
980 980
981int ivtv_v4l2_open(struct inode *inode, struct file *filp) 981int ivtv_v4l2_open(struct file *filp)
982{ 982{
983 int res; 983 int res;
984 struct ivtv *itv = NULL; 984 struct ivtv *itv = NULL;
diff --git a/drivers/media/video/ivtv/ivtv-fileops.h b/drivers/media/video/ivtv/ivtv-fileops.h
index df81e790147f..049a2923965d 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.h
+++ b/drivers/media/video/ivtv/ivtv-fileops.h
@@ -22,12 +22,12 @@
22#define IVTV_FILEOPS_H 22#define IVTV_FILEOPS_H
23 23
24/* Testing/Debugging */ 24/* Testing/Debugging */
25int ivtv_v4l2_open(struct inode *inode, struct file *filp); 25int ivtv_v4l2_open(struct file *filp);
26ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count, 26ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count,
27 loff_t * pos); 27 loff_t * pos);
28ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count, 28ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count,
29 loff_t * pos); 29 loff_t * pos);
30int ivtv_v4l2_close(struct inode *inode, struct file *filp); 30int ivtv_v4l2_close(struct file *filp);
31unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait); 31unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait);
32unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait); 32unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait);
33int ivtv_start_capture(struct ivtv_open_id *id); 33int ivtv_start_capture(struct ivtv_open_id *id);
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index cd990a4b81a9..a6cd02460e75 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1827,7 +1827,7 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp,
1827 1827
1828 if (ivtv_debug & IVTV_DBGFLG_IOCTL) 1828 if (ivtv_debug & IVTV_DBGFLG_IOCTL)
1829 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; 1829 vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
1830 ret = __video_ioctl2(filp, cmd, arg); 1830 ret = video_ioctl2(filp, cmd, arg);
1831 vfd->debug = 0; 1831 vfd->debug = 0;
1832 return ret; 1832 return ret;
1833} 1833}
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index f77d764707b2..854a950af78c 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -43,24 +43,22 @@
43#include "ivtv-cards.h" 43#include "ivtv-cards.h"
44#include "ivtv-streams.h" 44#include "ivtv-streams.h"
45 45
46static const struct file_operations ivtv_v4l2_enc_fops = { 46static const struct v4l2_file_operations ivtv_v4l2_enc_fops = {
47 .owner = THIS_MODULE, 47 .owner = THIS_MODULE,
48 .read = ivtv_v4l2_read, 48 .read = ivtv_v4l2_read,
49 .write = ivtv_v4l2_write, 49 .write = ivtv_v4l2_write,
50 .open = ivtv_v4l2_open, 50 .open = ivtv_v4l2_open,
51 .unlocked_ioctl = ivtv_v4l2_ioctl, 51 .unlocked_ioctl = ivtv_v4l2_ioctl,
52 .compat_ioctl = v4l_compat_ioctl32,
53 .release = ivtv_v4l2_close, 52 .release = ivtv_v4l2_close,
54 .poll = ivtv_v4l2_enc_poll, 53 .poll = ivtv_v4l2_enc_poll,
55}; 54};
56 55
57static const struct file_operations ivtv_v4l2_dec_fops = { 56static const struct v4l2_file_operations ivtv_v4l2_dec_fops = {
58 .owner = THIS_MODULE, 57 .owner = THIS_MODULE,
59 .read = ivtv_v4l2_read, 58 .read = ivtv_v4l2_read,
60 .write = ivtv_v4l2_write, 59 .write = ivtv_v4l2_write,
61 .open = ivtv_v4l2_open, 60 .open = ivtv_v4l2_open,
62 .unlocked_ioctl = ivtv_v4l2_ioctl, 61 .unlocked_ioctl = ivtv_v4l2_ioctl,
63 .compat_ioctl = v4l_compat_ioctl32,
64 .release = ivtv_v4l2_close, 62 .release = ivtv_v4l2_close,
65 .poll = ivtv_v4l2_dec_poll, 63 .poll = ivtv_v4l2_dec_poll,
66}; 64};
@@ -78,7 +76,7 @@ static struct {
78 int num_offset; 76 int num_offset;
79 int dma, pio; 77 int dma, pio;
80 enum v4l2_buf_type buf_type; 78 enum v4l2_buf_type buf_type;
81 const struct file_operations *fops; 79 const struct v4l2_file_operations *fops;
82} ivtv_stream_info[] = { 80} ivtv_stream_info[] = {
83 { /* IVTV_ENC_STREAM_TYPE_MPG */ 81 { /* IVTV_ENC_STREAM_TYPE_MPG */
84 "encoder MPG", 82 "encoder MPG",
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index 6418f4a78f2a..c408e615c415 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -841,7 +841,7 @@ again:
841/* video4linux integration */ 841/* video4linux integration */
842/****************************************************************************/ 842/****************************************************************************/
843 843
844static int meye_open(struct inode *inode, struct file *file) 844static int meye_open(struct file *file)
845{ 845{
846 int i; 846 int i;
847 847
@@ -863,7 +863,7 @@ static int meye_open(struct inode *inode, struct file *file)
863 return 0; 863 return 0;
864} 864}
865 865
866static int meye_release(struct inode *inode, struct file *file) 866static int meye_release(struct file *file)
867{ 867{
868 mchip_hic_stop(); 868 mchip_hic_stop();
869 mchip_dma_free(); 869 mchip_dma_free();
@@ -1684,17 +1684,13 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma)
1684 return 0; 1684 return 0;
1685} 1685}
1686 1686
1687static const struct file_operations meye_fops = { 1687static const struct v4l2_file_operations meye_fops = {
1688 .owner = THIS_MODULE, 1688 .owner = THIS_MODULE,
1689 .open = meye_open, 1689 .open = meye_open,
1690 .release = meye_release, 1690 .release = meye_release,
1691 .mmap = meye_mmap, 1691 .mmap = meye_mmap,
1692 .ioctl = video_ioctl2, 1692 .ioctl = video_ioctl2,
1693#ifdef CONFIG_COMPAT
1694 .compat_ioctl = v4l_compat_ioctl32,
1695#endif
1696 .poll = meye_poll, 1693 .poll = meye_poll,
1697 .llseek = no_llseek,
1698}; 1694};
1699 1695
1700static const struct v4l2_ioctl_ops meye_ioctl_ops = { 1696static const struct v4l2_ioctl_ops meye_ioctl_ops = {
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 85c3c7c92af1..73eb656acfe3 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1454,9 +1454,9 @@ static int omap24xxcam_mmap(struct file *file, struct vm_area_struct *vma)
1454 return rval; 1454 return rval;
1455} 1455}
1456 1456
1457static int omap24xxcam_open(struct inode *inode, struct file *file) 1457static int omap24xxcam_open(struct file *file)
1458{ 1458{
1459 int minor = iminor(inode); 1459 int minor = video_devdata(file)->minor;
1460 struct omap24xxcam_device *cam = omap24xxcam.priv; 1460 struct omap24xxcam_device *cam = omap24xxcam.priv;
1461 struct omap24xxcam_fh *fh; 1461 struct omap24xxcam_fh *fh;
1462 struct v4l2_format format; 1462 struct v4l2_format format;
@@ -1511,7 +1511,7 @@ out_try_module_get:
1511 return -ENODEV; 1511 return -ENODEV;
1512} 1512}
1513 1513
1514static int omap24xxcam_release(struct inode *inode, struct file *file) 1514static int omap24xxcam_release(struct file *file)
1515{ 1515{
1516 struct omap24xxcam_fh *fh = file->private_data; 1516 struct omap24xxcam_fh *fh = file->private_data;
1517 struct omap24xxcam_device *cam = fh->cam; 1517 struct omap24xxcam_device *cam = fh->cam;
@@ -1559,8 +1559,7 @@ static int omap24xxcam_release(struct inode *inode, struct file *file)
1559 return 0; 1559 return 0;
1560} 1560}
1561 1561
1562static struct file_operations omap24xxcam_fops = { 1562static struct v4l2_file_operations omap24xxcam_fops = {
1563 .llseek = no_llseek,
1564 .ioctl = video_ioctl2, 1563 .ioctl = video_ioctl2,
1565 .poll = omap24xxcam_poll, 1564 .poll = omap24xxcam_poll,
1566 .mmap = omap24xxcam_mmap, 1565 .mmap = omap24xxcam_mmap,
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index 6ee9b69cc4a9..f1754dc5587e 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -3915,7 +3915,7 @@ ov51x_dealloc(struct usb_ov511 *ov)
3915 ***************************************************************************/ 3915 ***************************************************************************/
3916 3916
3917static int 3917static int
3918ov51x_v4l1_open(struct inode *inode, struct file *file) 3918ov51x_v4l1_open(struct file *file)
3919{ 3919{
3920 struct video_device *vdev = video_devdata(file); 3920 struct video_device *vdev = video_devdata(file);
3921 struct usb_ov511 *ov = video_get_drvdata(vdev); 3921 struct usb_ov511 *ov = video_get_drvdata(vdev);
@@ -3972,7 +3972,7 @@ out:
3972} 3972}
3973 3973
3974static int 3974static int
3975ov51x_v4l1_close(struct inode *inode, struct file *file) 3975ov51x_v4l1_close(struct file *file)
3976{ 3976{
3977 struct video_device *vdev = file->private_data; 3977 struct video_device *vdev = file->private_data;
3978 struct usb_ov511 *ov = video_get_drvdata(vdev); 3978 struct usb_ov511 *ov = video_get_drvdata(vdev);
@@ -4450,7 +4450,7 @@ redo:
4450} 4450}
4451 4451
4452static int 4452static int
4453ov51x_v4l1_ioctl(struct inode *inode, struct file *file, 4453ov51x_v4l1_ioctl(struct file *file,
4454 unsigned int cmd, unsigned long arg) 4454 unsigned int cmd, unsigned long arg)
4455{ 4455{
4456 struct video_device *vdev = file->private_data; 4456 struct video_device *vdev = file->private_data;
@@ -4661,17 +4661,13 @@ ov51x_v4l1_mmap(struct file *file, struct vm_area_struct *vma)
4661 return 0; 4661 return 0;
4662} 4662}
4663 4663
4664static const struct file_operations ov511_fops = { 4664static const struct v4l2_file_operations ov511_fops = {
4665 .owner = THIS_MODULE, 4665 .owner = THIS_MODULE,
4666 .open = ov51x_v4l1_open, 4666 .open = ov51x_v4l1_open,
4667 .release = ov51x_v4l1_close, 4667 .release = ov51x_v4l1_close,
4668 .read = ov51x_v4l1_read, 4668 .read = ov51x_v4l1_read,
4669 .mmap = ov51x_v4l1_mmap, 4669 .mmap = ov51x_v4l1_mmap,
4670 .ioctl = ov51x_v4l1_ioctl, 4670 .ioctl = ov51x_v4l1_ioctl,
4671#ifdef CONFIG_COMPAT
4672 .compat_ioctl = v4l_compat_ioctl32,
4673#endif
4674 .llseek = no_llseek,
4675}; 4671};
4676 4672
4677static struct video_device vdev_template = { 4673static struct video_device vdev_template = {
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c
index 45730fac1570..24f2b3d9977f 100644
--- a/drivers/media/video/pms.c
+++ b/drivers/media/video/pms.c
@@ -862,7 +862,7 @@ static int pms_do_ioctl(struct file *file, unsigned int cmd, void *arg)
862 return 0; 862 return 0;
863} 863}
864 864
865static int pms_ioctl(struct inode *inode, struct file *file, 865static int pms_ioctl(struct file *file,
866 unsigned int cmd, unsigned long arg) 866 unsigned int cmd, unsigned long arg)
867{ 867{
868 return video_usercopy(file, cmd, arg, pms_do_ioctl); 868 return video_usercopy(file, cmd, arg, pms_do_ioctl);
@@ -881,7 +881,7 @@ static ssize_t pms_read(struct file *file, char __user *buf,
881 return len; 881 return len;
882} 882}
883 883
884static int pms_exclusive_open(struct inode *inode, struct file *file) 884static int pms_exclusive_open(struct file *file)
885{ 885{
886 struct video_device *v = video_devdata(file); 886 struct video_device *v = video_devdata(file);
887 struct pms_device *pd = (struct pms_device *)v; 887 struct pms_device *pd = (struct pms_device *)v;
@@ -889,7 +889,7 @@ static int pms_exclusive_open(struct inode *inode, struct file *file)
889 return test_and_set_bit(0, &pd->in_use) ? -EBUSY : 0; 889 return test_and_set_bit(0, &pd->in_use) ? -EBUSY : 0;
890} 890}
891 891
892static int pms_exclusive_release(struct inode *inode, struct file *file) 892static int pms_exclusive_release(struct file *file)
893{ 893{
894 struct video_device *v = video_devdata(file); 894 struct video_device *v = video_devdata(file);
895 struct pms_device *pd = (struct pms_device *)v; 895 struct pms_device *pd = (struct pms_device *)v;
@@ -898,16 +898,12 @@ static int pms_exclusive_release(struct inode *inode, struct file *file)
898 return 0; 898 return 0;
899} 899}
900 900
901static const struct file_operations pms_fops = { 901static const struct v4l2_file_operations pms_fops = {
902 .owner = THIS_MODULE, 902 .owner = THIS_MODULE,
903 .open = pms_exclusive_open, 903 .open = pms_exclusive_open,
904 .release = pms_exclusive_release, 904 .release = pms_exclusive_release,
905 .ioctl = pms_ioctl, 905 .ioctl = pms_ioctl,
906#ifdef CONFIG_COMPAT
907 .compat_ioctl = v4l_compat_ioctl32,
908#endif
909 .read = pms_read, 906 .read = pms_read,
910 .llseek = no_llseek,
911}; 907};
912 908
913static struct video_device pms_template= 909static struct video_device pms_template=
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 52af1c435965..50554b44d355 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -948,7 +948,7 @@ static void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
948} 948}
949 949
950 950
951static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, 951static int pvr2_v4l2_ioctl(struct file *file,
952 unsigned int cmd, unsigned long arg) 952 unsigned int cmd, unsigned long arg)
953{ 953{
954 954
@@ -960,7 +960,7 @@ static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file,
960} 960}
961 961
962 962
963static int pvr2_v4l2_release(struct inode *inode, struct file *file) 963static int pvr2_v4l2_release(struct file *file)
964{ 964{
965 struct pvr2_v4l2_fh *fhp = file->private_data; 965 struct pvr2_v4l2_fh *fhp = file->private_data;
966 struct pvr2_v4l2 *vp = fhp->vhead; 966 struct pvr2_v4l2 *vp = fhp->vhead;
@@ -1008,7 +1008,7 @@ static int pvr2_v4l2_release(struct inode *inode, struct file *file)
1008} 1008}
1009 1009
1010 1010
1011static int pvr2_v4l2_open(struct inode *inode, struct file *file) 1011static int pvr2_v4l2_open(struct file *file)
1012{ 1012{
1013 struct pvr2_v4l2_dev *dip; /* Our own context pointer */ 1013 struct pvr2_v4l2_dev *dip; /* Our own context pointer */
1014 struct pvr2_v4l2_fh *fhp; 1014 struct pvr2_v4l2_fh *fhp;
@@ -1235,13 +1235,12 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait)
1235} 1235}
1236 1236
1237 1237
1238static const struct file_operations vdev_fops = { 1238static const struct v4l2_file_operations vdev_fops = {
1239 .owner = THIS_MODULE, 1239 .owner = THIS_MODULE,
1240 .open = pvr2_v4l2_open, 1240 .open = pvr2_v4l2_open,
1241 .release = pvr2_v4l2_release, 1241 .release = pvr2_v4l2_release,
1242 .read = pvr2_v4l2_read, 1242 .read = pvr2_v4l2_read,
1243 .ioctl = pvr2_v4l2_ioctl, 1243 .ioctl = pvr2_v4l2_ioctl,
1244 .llseek = no_llseek,
1245 .poll = pvr2_v4l2_poll, 1244 .poll = pvr2_v4l2_poll,
1246}; 1245};
1247 1246
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index 1ce9da167b7e..315337bfd673 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -142,16 +142,16 @@ static struct {
142 142
143/***/ 143/***/
144 144
145static int pwc_video_open(struct inode *inode, struct file *file); 145static int pwc_video_open(struct file *file);
146static int pwc_video_close(struct inode *inode, struct file *file); 146static int pwc_video_close(struct file *file);
147static ssize_t pwc_video_read(struct file *file, char __user *buf, 147static ssize_t pwc_video_read(struct file *file, char __user *buf,
148 size_t count, loff_t *ppos); 148 size_t count, loff_t *ppos);
149static unsigned int pwc_video_poll(struct file *file, poll_table *wait); 149static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
150static int pwc_video_ioctl(struct inode *inode, struct file *file, 150static int pwc_video_ioctl(struct file *file,
151 unsigned int ioctlnr, unsigned long arg); 151 unsigned int ioctlnr, unsigned long arg);
152static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma); 152static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma);
153 153
154static const struct file_operations pwc_fops = { 154static const struct v4l2_file_operations pwc_fops = {
155 .owner = THIS_MODULE, 155 .owner = THIS_MODULE,
156 .open = pwc_video_open, 156 .open = pwc_video_open,
157 .release = pwc_video_close, 157 .release = pwc_video_close,
@@ -159,10 +159,6 @@ static const struct file_operations pwc_fops = {
159 .poll = pwc_video_poll, 159 .poll = pwc_video_poll,
160 .mmap = pwc_video_mmap, 160 .mmap = pwc_video_mmap,
161 .ioctl = pwc_video_ioctl, 161 .ioctl = pwc_video_ioctl,
162#ifdef CONFIG_COMPAT
163 .compat_ioctl = v4l_compat_ioctl32,
164#endif
165 .llseek = no_llseek,
166}; 162};
167static struct video_device pwc_template = { 163static struct video_device pwc_template = {
168 .name = "Philips Webcam", /* Filled in later */ 164 .name = "Philips Webcam", /* Filled in later */
@@ -1104,7 +1100,7 @@ static const char *pwc_sensor_type_to_string(unsigned int sensor_type)
1104/***************************************************************************/ 1100/***************************************************************************/
1105/* Video4Linux functions */ 1101/* Video4Linux functions */
1106 1102
1107static int pwc_video_open(struct inode *inode, struct file *file) 1103static int pwc_video_open(struct file *file)
1108{ 1104{
1109 int i, ret; 1105 int i, ret;
1110 struct video_device *vdev = video_devdata(file); 1106 struct video_device *vdev = video_devdata(file);
@@ -1224,7 +1220,7 @@ static void pwc_cleanup(struct pwc_device *pdev)
1224} 1220}
1225 1221
1226/* Note that all cleanup is done in the reverse order as in _open */ 1222/* Note that all cleanup is done in the reverse order as in _open */
1227static int pwc_video_close(struct inode *inode, struct file *file) 1223static int pwc_video_close(struct file *file)
1228{ 1224{
1229 struct video_device *vdev = file->private_data; 1225 struct video_device *vdev = file->private_data;
1230 struct pwc_device *pdev; 1226 struct pwc_device *pdev;
@@ -1399,7 +1395,7 @@ static unsigned int pwc_video_poll(struct file *file, poll_table *wait)
1399 return 0; 1395 return 0;
1400} 1396}
1401 1397
1402static int pwc_video_ioctl(struct inode *inode, struct file *file, 1398static int pwc_video_ioctl(struct file *file,
1403 unsigned int cmd, unsigned long arg) 1399 unsigned int cmd, unsigned long arg)
1404{ 1400{
1405 struct video_device *vdev = file->private_data; 1401 struct video_device *vdev = file->private_data;
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 3c3f8cf73108..13f85ad363cd 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -1502,9 +1502,9 @@ static int vidioc_s_jpegcomp(struct file *file, void *priv,
1502 dprintk(2, "setting jpeg quality %d\n", jc->quality); 1502 dprintk(2, "setting jpeg quality %d\n", jc->quality);
1503 return 0; 1503 return 0;
1504} 1504}
1505static int s2255_open(struct inode *inode, struct file *file) 1505static int s2255_open(struct file *file)
1506{ 1506{
1507 int minor = iminor(inode); 1507 int minor = video_devdata(file)->minor;
1508 struct s2255_dev *h, *dev = NULL; 1508 struct s2255_dev *h, *dev = NULL;
1509 struct s2255_fh *fh; 1509 struct s2255_fh *fh;
1510 struct list_head *list; 1510 struct list_head *list;
@@ -1711,11 +1711,11 @@ static void s2255_destroy(struct kref *kref)
1711 mutex_unlock(&dev->open_lock); 1711 mutex_unlock(&dev->open_lock);
1712} 1712}
1713 1713
1714static int s2255_close(struct inode *inode, struct file *file) 1714static int s2255_close(struct file *file)
1715{ 1715{
1716 struct s2255_fh *fh = file->private_data; 1716 struct s2255_fh *fh = file->private_data;
1717 struct s2255_dev *dev = fh->dev; 1717 struct s2255_dev *dev = fh->dev;
1718 int minor = iminor(inode); 1718 int minor = video_devdata(file)->minor;
1719 if (!dev) 1719 if (!dev)
1720 return -ENODEV; 1720 return -ENODEV;
1721 1721
@@ -1759,15 +1759,13 @@ static int s2255_mmap_v4l(struct file *file, struct vm_area_struct *vma)
1759 return ret; 1759 return ret;
1760} 1760}
1761 1761
1762static const struct file_operations s2255_fops_v4l = { 1762static const struct v4l2_file_operations s2255_fops_v4l = {
1763 .owner = THIS_MODULE, 1763 .owner = THIS_MODULE,
1764 .open = s2255_open, 1764 .open = s2255_open,
1765 .release = s2255_close, 1765 .release = s2255_close,
1766 .poll = s2255_poll, 1766 .poll = s2255_poll,
1767 .ioctl = video_ioctl2, /* V4L2 ioctl handler */ 1767 .ioctl = video_ioctl2, /* V4L2 ioctl handler */
1768 .compat_ioctl = v4l_compat_ioctl32,
1769 .mmap = s2255_mmap_v4l, 1768 .mmap = s2255_mmap_v4l,
1770 .llseek = no_llseek,
1771}; 1769};
1772 1770
1773static const struct v4l2_ioctl_ops s2255_ioctl_ops = { 1771static const struct v4l2_ioctl_ops s2255_ioctl_ops = {
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index f159441e9375..018dee55b3aa 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -944,7 +944,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
944/* 944/*
945 * Handle the locking 945 * Handle the locking
946 */ 946 */
947static int saa5246a_ioctl(struct inode *inode, struct file *file, 947static int saa5246a_ioctl(struct file *file,
948 unsigned int cmd, unsigned long arg) 948 unsigned int cmd, unsigned long arg)
949{ 949{
950 struct saa5246a_device *t = video_drvdata(file); 950 struct saa5246a_device *t = video_drvdata(file);
@@ -957,7 +957,7 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file,
957 return err; 957 return err;
958} 958}
959 959
960static int saa5246a_open(struct inode *inode, struct file *file) 960static int saa5246a_open(struct file *file)
961{ 961{
962 struct saa5246a_device *t = video_drvdata(file); 962 struct saa5246a_device *t = video_drvdata(file);
963 963
@@ -999,7 +999,7 @@ static int saa5246a_open(struct inode *inode, struct file *file)
999 return 0; 999 return 0;
1000} 1000}
1001 1001
1002static int saa5246a_release(struct inode *inode, struct file *file) 1002static int saa5246a_release(struct file *file)
1003{ 1003{
1004 struct saa5246a_device *t = video_drvdata(file); 1004 struct saa5246a_device *t = video_drvdata(file);
1005 1005
@@ -1018,12 +1018,11 @@ static int saa5246a_release(struct inode *inode, struct file *file)
1018 return 0; 1018 return 0;
1019} 1019}
1020 1020
1021static const struct file_operations saa_fops = { 1021static const struct v4l2_file_operations saa_fops = {
1022 .owner = THIS_MODULE, 1022 .owner = THIS_MODULE,
1023 .open = saa5246a_open, 1023 .open = saa5246a_open,
1024 .release = saa5246a_release, 1024 .release = saa5246a_release,
1025 .ioctl = saa5246a_ioctl, 1025 .ioctl = saa5246a_ioctl,
1026 .llseek = no_llseek,
1027}; 1026};
1028 1027
1029static struct video_device saa_template = 1028static struct video_device saa_template =
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 6ef3affb97f1..e73bb738933c 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -479,7 +479,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
479 * Handle the locking 479 * Handle the locking
480 */ 480 */
481 481
482static int saa5249_ioctl(struct inode *inode, struct file *file, 482static int saa5249_ioctl(struct file *file,
483 unsigned int cmd, unsigned long arg) 483 unsigned int cmd, unsigned long arg)
484{ 484{
485 struct saa5249_device *t = video_drvdata(file); 485 struct saa5249_device *t = video_drvdata(file);
@@ -492,7 +492,7 @@ static int saa5249_ioctl(struct inode *inode, struct file *file,
492 return err; 492 return err;
493} 493}
494 494
495static int saa5249_open(struct inode *inode, struct file *file) 495static int saa5249_open(struct file *file)
496{ 496{
497 struct saa5249_device *t = video_drvdata(file); 497 struct saa5249_device *t = video_drvdata(file);
498 int pgbuf; 498 int pgbuf;
@@ -529,7 +529,7 @@ static int saa5249_open(struct inode *inode, struct file *file)
529 529
530 530
531 531
532static int saa5249_release(struct inode *inode, struct file *file) 532static int saa5249_release(struct file *file)
533{ 533{
534 struct saa5249_device *t = video_drvdata(file); 534 struct saa5249_device *t = video_drvdata(file);
535 535
@@ -539,15 +539,11 @@ static int saa5249_release(struct inode *inode, struct file *file)
539 return 0; 539 return 0;
540} 540}
541 541
542static const struct file_operations saa_fops = { 542static const struct v4l2_file_operations saa_fops = {
543 .owner = THIS_MODULE, 543 .owner = THIS_MODULE,
544 .open = saa5249_open, 544 .open = saa5249_open,
545 .release = saa5249_release, 545 .release = saa5249_release,
546 .ioctl = saa5249_ioctl, 546 .ioctl = saa5249_ioctl,
547#ifdef CONFIG_COMPAT
548 .compat_ioctl = v4l_compat_ioctl32,
549#endif
550 .llseek = no_llseek,
551}; 547};
552 548
553static struct video_device saa_template = 549static struct video_device saa_template =
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 7f40511bcc04..3beba480137f 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -83,9 +83,9 @@ static int ts_init_encoder(struct saa7134_dev* dev)
83 83
84/* ------------------------------------------------------------------ */ 84/* ------------------------------------------------------------------ */
85 85
86static int ts_open(struct inode *inode, struct file *file) 86static int ts_open(struct file *file)
87{ 87{
88 int minor = iminor(inode); 88 int minor = video_devdata(file)->minor;
89 struct saa7134_dev *dev; 89 struct saa7134_dev *dev;
90 int err; 90 int err;
91 91
@@ -119,7 +119,7 @@ done:
119 return err; 119 return err;
120} 120}
121 121
122static int ts_release(struct inode *inode, struct file *file) 122static int ts_release(struct file *file)
123{ 123{
124 struct saa7134_dev *dev = file->private_data; 124 struct saa7134_dev *dev = file->private_data;
125 125
@@ -437,7 +437,7 @@ static int empress_g_std(struct file *file, void *priv, v4l2_std_id *id)
437 return 0; 437 return 0;
438} 438}
439 439
440static const struct file_operations ts_fops = 440static const struct v4l2_file_operations ts_fops =
441{ 441{
442 .owner = THIS_MODULE, 442 .owner = THIS_MODULE,
443 .open = ts_open, 443 .open = ts_open,
@@ -446,7 +446,6 @@ static const struct file_operations ts_fops =
446 .poll = ts_poll, 446 .poll = ts_poll,
447 .mmap = ts_mmap, 447 .mmap = ts_mmap,
448 .ioctl = video_ioctl2, 448 .ioctl = video_ioctl2,
449 .llseek = no_llseek,
450}; 449};
451 450
452static const struct v4l2_ioctl_ops ts_ioctl_ops = { 451static const struct v4l2_ioctl_ops ts_ioctl_ops = {
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 02bb6747a39c..6b2ab57538ee 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1326,9 +1326,9 @@ static int saa7134_resource(struct saa7134_fh *fh)
1326 return 0; 1326 return 0;
1327} 1327}
1328 1328
1329static int video_open(struct inode *inode, struct file *file) 1329static int video_open(struct file *file)
1330{ 1330{
1331 int minor = iminor(inode); 1331 int minor = video_devdata(file)->minor;
1332 struct saa7134_dev *dev; 1332 struct saa7134_dev *dev;
1333 struct saa7134_fh *fh; 1333 struct saa7134_fh *fh;
1334 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1334 enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -1462,7 +1462,7 @@ err:
1462 return POLLERR; 1462 return POLLERR;
1463} 1463}
1464 1464
1465static int video_release(struct inode *inode, struct file *file) 1465static int video_release(struct file *file)
1466{ 1466{
1467 struct saa7134_fh *fh = file->private_data; 1467 struct saa7134_fh *fh = file->private_data;
1468 struct saa7134_dev *dev = fh->dev; 1468 struct saa7134_dev *dev = fh->dev;
@@ -2377,7 +2377,7 @@ static int radio_queryctrl(struct file *file, void *priv,
2377 return 0; 2377 return 0;
2378} 2378}
2379 2379
2380static const struct file_operations video_fops = 2380static const struct v4l2_file_operations video_fops =
2381{ 2381{
2382 .owner = THIS_MODULE, 2382 .owner = THIS_MODULE,
2383 .open = video_open, 2383 .open = video_open,
@@ -2386,8 +2386,6 @@ static const struct file_operations video_fops =
2386 .poll = video_poll, 2386 .poll = video_poll,
2387 .mmap = video_mmap, 2387 .mmap = video_mmap,
2388 .ioctl = video_ioctl2, 2388 .ioctl = video_ioctl2,
2389 .compat_ioctl = v4l_compat_ioctl32,
2390 .llseek = no_llseek,
2391}; 2389};
2392 2390
2393static const struct v4l2_ioctl_ops video_ioctl_ops = { 2391static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -2441,13 +2439,11 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
2441#endif 2439#endif
2442}; 2440};
2443 2441
2444static const struct file_operations radio_fops = { 2442static const struct v4l2_file_operations radio_fops = {
2445 .owner = THIS_MODULE, 2443 .owner = THIS_MODULE,
2446 .open = video_open, 2444 .open = video_open,
2447 .release = video_release, 2445 .release = video_release,
2448 .ioctl = video_ioctl2, 2446 .ioctl = video_ioctl2,
2449 .compat_ioctl = v4l_compat_ioctl32,
2450 .llseek = no_llseek,
2451}; 2447};
2452 2448
2453static const struct v4l2_ioctl_ops radio_ioctl_ops = { 2449static const struct v4l2_ioctl_ops radio_ioctl_ops = {
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index d652f25eef0e..5b27f323272f 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -932,7 +932,7 @@ static void usb_se401_remove_disconnected (struct usb_se401 *se401)
932 ***************************************************************************/ 932 ***************************************************************************/
933 933
934 934
935static int se401_open(struct inode *inode, struct file *file) 935static int se401_open(struct file *file)
936{ 936{
937 struct video_device *dev = video_devdata(file); 937 struct video_device *dev = video_devdata(file);
938 struct usb_se401 *se401 = (struct usb_se401 *)dev; 938 struct usb_se401 *se401 = (struct usb_se401 *)dev;
@@ -954,7 +954,7 @@ static int se401_open(struct inode *inode, struct file *file)
954 return err; 954 return err;
955} 955}
956 956
957static int se401_close(struct inode *inode, struct file *file) 957static int se401_close(struct file *file)
958{ 958{
959 struct video_device *dev = file->private_data; 959 struct video_device *dev = file->private_data;
960 struct usb_se401 *se401 = (struct usb_se401 *)dev; 960 struct usb_se401 *se401 = (struct usb_se401 *)dev;
@@ -1138,7 +1138,7 @@ static int se401_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1138 return 0; 1138 return 0;
1139} 1139}
1140 1140
1141static int se401_ioctl(struct inode *inode, struct file *file, 1141static int se401_ioctl(struct file *file,
1142 unsigned int cmd, unsigned long arg) 1142 unsigned int cmd, unsigned long arg)
1143{ 1143{
1144 return video_usercopy(file, cmd, arg, se401_do_ioctl); 1144 return video_usercopy(file, cmd, arg, se401_do_ioctl);
@@ -1222,17 +1222,13 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma)
1222 return 0; 1222 return 0;
1223} 1223}
1224 1224
1225static const struct file_operations se401_fops = { 1225static const struct v4l2_file_operations se401_fops = {
1226 .owner = THIS_MODULE, 1226 .owner = THIS_MODULE,
1227 .open = se401_open, 1227 .open = se401_open,
1228 .release = se401_close, 1228 .release = se401_close,
1229 .read = se401_read, 1229 .read = se401_read,
1230 .mmap = se401_mmap, 1230 .mmap = se401_mmap,
1231 .ioctl = se401_ioctl, 1231 .ioctl = se401_ioctl,
1232#ifdef CONFIG_COMPAT
1233 .compat_ioctl = v4l_compat_ioctl32,
1234#endif
1235 .llseek = no_llseek,
1236}; 1232};
1237static struct video_device se401_template = { 1233static struct video_device se401_template = {
1238 .name = "se401 USB camera", 1234 .name = "se401 USB camera",
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index 01a8efb8deb1..c2582e248fa3 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -1746,7 +1746,7 @@ static void sn9c102_release_resources(struct kref *kref)
1746} 1746}
1747 1747
1748 1748
1749static int sn9c102_open(struct inode* inode, struct file* filp) 1749static int sn9c102_open(struct file *filp)
1750{ 1750{
1751 struct sn9c102_device* cam; 1751 struct sn9c102_device* cam;
1752 int err = 0; 1752 int err = 0;
@@ -1857,7 +1857,7 @@ out:
1857} 1857}
1858 1858
1859 1859
1860static int sn9c102_release(struct inode* inode, struct file* filp) 1860static int sn9c102_release(struct file *filp)
1861{ 1861{
1862 struct sn9c102_device* cam; 1862 struct sn9c102_device* cam;
1863 1863
@@ -3092,8 +3092,8 @@ sn9c102_vidioc_s_audio(struct sn9c102_device* cam, void __user * arg)
3092} 3092}
3093 3093
3094 3094
3095static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, 3095static int sn9c102_ioctl_v4l2(struct file *filp,
3096 unsigned int cmd, void __user * arg) 3096 unsigned int cmd, void __user *arg)
3097{ 3097{
3098 struct sn9c102_device *cam = video_drvdata(filp); 3098 struct sn9c102_device *cam = video_drvdata(filp);
3099 3099
@@ -3196,7 +3196,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
3196} 3196}
3197 3197
3198 3198
3199static int sn9c102_ioctl(struct inode* inode, struct file* filp, 3199static int sn9c102_ioctl(struct file *filp,
3200 unsigned int cmd, unsigned long arg) 3200 unsigned int cmd, unsigned long arg)
3201{ 3201{
3202 struct sn9c102_device *cam = video_drvdata(filp); 3202 struct sn9c102_device *cam = video_drvdata(filp);
@@ -3220,7 +3220,7 @@ static int sn9c102_ioctl(struct inode* inode, struct file* filp,
3220 3220
3221 V4LDBG(3, "sn9c102", cmd); 3221 V4LDBG(3, "sn9c102", cmd);
3222 3222
3223 err = sn9c102_ioctl_v4l2(inode, filp, cmd, (void __user *)arg); 3223 err = sn9c102_ioctl_v4l2(filp, cmd, (void __user *)arg);
3224 3224
3225 mutex_unlock(&cam->fileop_mutex); 3225 mutex_unlock(&cam->fileop_mutex);
3226 3226
@@ -3229,18 +3229,14 @@ static int sn9c102_ioctl(struct inode* inode, struct file* filp,
3229 3229
3230/*****************************************************************************/ 3230/*****************************************************************************/
3231 3231
3232static const struct file_operations sn9c102_fops = { 3232static const struct v4l2_file_operations sn9c102_fops = {
3233 .owner = THIS_MODULE, 3233 .owner = THIS_MODULE,
3234 .open = sn9c102_open, 3234 .open = sn9c102_open,
3235 .release = sn9c102_release, 3235 .release = sn9c102_release,
3236 .ioctl = sn9c102_ioctl, 3236 .ioctl = sn9c102_ioctl,
3237#ifdef CONFIG_COMPAT
3238 .compat_ioctl = v4l_compat_ioctl32,
3239#endif
3240 .read = sn9c102_read, 3237 .read = sn9c102_read,
3241 .poll = sn9c102_poll, 3238 .poll = sn9c102_poll,
3242 .mmap = sn9c102_mmap, 3239 .mmap = sn9c102_mmap,
3243 .llseek = no_llseek,
3244}; 3240};
3245 3241
3246/*****************************************************************************/ 3242/*****************************************************************************/
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 90077cb4fe66..9986e02bcf1a 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -256,7 +256,7 @@ static void soc_camera_free_user_formats(struct soc_camera_device *icd)
256 vfree(icd->user_formats); 256 vfree(icd->user_formats);
257} 257}
258 258
259static int soc_camera_open(struct inode *inode, struct file *file) 259static int soc_camera_open(struct file *file)
260{ 260{
261 struct video_device *vdev; 261 struct video_device *vdev;
262 struct soc_camera_device *icd; 262 struct soc_camera_device *icd;
@@ -330,7 +330,7 @@ emgd:
330 return ret; 330 return ret;
331} 331}
332 332
333static int soc_camera_close(struct inode *inode, struct file *file) 333static int soc_camera_close(struct file *file)
334{ 334{
335 struct soc_camera_file *icf = file->private_data; 335 struct soc_camera_file *icf = file->private_data;
336 struct soc_camera_device *icd = icf->icd; 336 struct soc_camera_device *icd = icf->icd;
@@ -400,7 +400,7 @@ static unsigned int soc_camera_poll(struct file *file, poll_table *pt)
400 return ici->ops->poll(file, pt); 400 return ici->ops->poll(file, pt);
401} 401}
402 402
403static struct file_operations soc_camera_fops = { 403static struct v4l2_file_operations soc_camera_fops = {
404 .owner = THIS_MODULE, 404 .owner = THIS_MODULE,
405 .open = soc_camera_open, 405 .open = soc_camera_open,
406 .release = soc_camera_close, 406 .release = soc_camera_close,
@@ -408,7 +408,6 @@ static struct file_operations soc_camera_fops = {
408 .read = soc_camera_read, 408 .read = soc_camera_read,
409 .mmap = soc_camera_mmap, 409 .mmap = soc_camera_mmap,
410 .poll = soc_camera_poll, 410 .poll = soc_camera_poll,
411 .llseek = no_llseek,
412}; 411};
413 412
414static int soc_camera_s_fmt_vid_cap(struct file *file, void *priv, 413static int soc_camera_s_fmt_vid_cap(struct file *file, void *priv,
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index f9516d0f3c11..26378cf390fc 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -664,7 +664,7 @@ static void stk_free_buffers(struct stk_camera *dev)
664 664
665/* v4l file operations */ 665/* v4l file operations */
666 666
667static int v4l_stk_open(struct inode *inode, struct file *fp) 667static int v4l_stk_open(struct file *fp)
668{ 668{
669 struct stk_camera *dev; 669 struct stk_camera *dev;
670 struct video_device *vdev; 670 struct video_device *vdev;
@@ -684,7 +684,7 @@ static int v4l_stk_open(struct inode *inode, struct file *fp)
684 return 0; 684 return 0;
685} 685}
686 686
687static int v4l_stk_release(struct inode *inode, struct file *fp) 687static int v4l_stk_release(struct file *fp)
688{ 688{
689 struct stk_camera *dev = fp->private_data; 689 struct stk_camera *dev = fp->private_data;
690 690
@@ -1281,7 +1281,7 @@ static int stk_vidioc_enum_framesizes(struct file *filp,
1281 } 1281 }
1282} 1282}
1283 1283
1284static struct file_operations v4l_stk_fops = { 1284static struct v4l2_file_operations v4l_stk_fops = {
1285 .owner = THIS_MODULE, 1285 .owner = THIS_MODULE,
1286 .open = v4l_stk_open, 1286 .open = v4l_stk_open,
1287 .release = v4l_stk_release, 1287 .release = v4l_stk_release,
@@ -1289,10 +1289,6 @@ static struct file_operations v4l_stk_fops = {
1289 .poll = v4l_stk_poll, 1289 .poll = v4l_stk_poll,
1290 .mmap = v4l_stk_mmap, 1290 .mmap = v4l_stk_mmap,
1291 .ioctl = video_ioctl2, 1291 .ioctl = video_ioctl2,
1292#ifdef CONFIG_COMPAT
1293 .compat_ioctl = v4l_compat_ioctl32,
1294#endif
1295 .llseek = no_llseek
1296}; 1292};
1297 1293
1298static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = { 1294static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index bbad54f85c83..10d2608501ae 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -1275,7 +1275,7 @@ static void make_clip_tab(struct saa7146 *saa, struct video_clip *cr, int ncr)
1275 clip_draw_rectangle(clipmap, 0, 0, 1024, -saa->win.y); 1275 clip_draw_rectangle(clipmap, 0, 0, 1024, -saa->win.y);
1276} 1276}
1277 1277
1278static int saa_ioctl(struct inode *inode, struct file *file, 1278static int saa_ioctl(struct file *file,
1279 unsigned int cmd, unsigned long argl) 1279 unsigned int cmd, unsigned long argl)
1280{ 1280{
1281 struct saa7146 *saa = file->private_data; 1281 struct saa7146 *saa = file->private_data;
@@ -1877,7 +1877,7 @@ static ssize_t saa_write(struct file *file, const char __user * buf,
1877 return count; 1877 return count;
1878} 1878}
1879 1879
1880static int saa_open(struct inode *inode, struct file *file) 1880static int saa_open(struct file *file)
1881{ 1881{
1882 struct video_device *vdev = video_devdata(file); 1882 struct video_device *vdev = video_devdata(file);
1883 struct saa7146 *saa = container_of(vdev, struct saa7146, video_dev); 1883 struct saa7146 *saa = container_of(vdev, struct saa7146, video_dev);
@@ -1895,7 +1895,7 @@ static int saa_open(struct inode *inode, struct file *file)
1895 return 0; 1895 return 0;
1896} 1896}
1897 1897
1898static int saa_release(struct inode *inode, struct file *file) 1898static int saa_release(struct file *file)
1899{ 1899{
1900 struct saa7146 *saa = file->private_data; 1900 struct saa7146 *saa = file->private_data;
1901 saa->user--; 1901 saa->user--;
@@ -1906,16 +1906,12 @@ static int saa_release(struct inode *inode, struct file *file)
1906 return 0; 1906 return 0;
1907} 1907}
1908 1908
1909static const struct file_operations saa_fops = { 1909static const struct v4l2_file_operations saa_fops = {
1910 .owner = THIS_MODULE, 1910 .owner = THIS_MODULE,
1911 .open = saa_open, 1911 .open = saa_open,
1912 .release = saa_release, 1912 .release = saa_release,
1913 .ioctl = saa_ioctl, 1913 .ioctl = saa_ioctl,
1914#ifdef CONFIG_COMPAT
1915 .compat_ioctl = v4l_compat_ioctl32,
1916#endif
1917 .read = saa_read, 1914 .read = saa_read,
1918 .llseek = no_llseek,
1919 .write = saa_write, 1915 .write = saa_write,
1920 .mmap = saa_mmap, 1916 .mmap = saa_mmap,
1921}; 1917};
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 42acc92c182d..0783b0a23f8a 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -1080,7 +1080,7 @@ static int stv680_newframe (struct usb_stv *stv680, int framenr)
1080 * Video4Linux 1080 * Video4Linux
1081 *********************************************************************/ 1081 *********************************************************************/
1082 1082
1083static int stv_open (struct inode *inode, struct file *file) 1083static int stv_open(struct file *file)
1084{ 1084{
1085 struct video_device *dev = video_devdata(file); 1085 struct video_device *dev = video_devdata(file);
1086 struct usb_stv *stv680 = video_get_drvdata(dev); 1086 struct usb_stv *stv680 = video_get_drvdata(dev);
@@ -1106,7 +1106,7 @@ static int stv_open (struct inode *inode, struct file *file)
1106 return err; 1106 return err;
1107} 1107}
1108 1108
1109static int stv_close (struct inode *inode, struct file *file) 1109static int stv_close(struct file *file)
1110{ 1110{
1111 struct video_device *dev = file->private_data; 1111 struct video_device *dev = file->private_data;
1112 struct usb_stv *stv680 = video_get_drvdata(dev); 1112 struct usb_stv *stv680 = video_get_drvdata(dev);
@@ -1299,7 +1299,7 @@ static int stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1299 return 0; 1299 return 0;
1300} 1300}
1301 1301
1302static int stv680_ioctl(struct inode *inode, struct file *file, 1302static int stv680_ioctl(struct file *file,
1303 unsigned int cmd, unsigned long arg) 1303 unsigned int cmd, unsigned long arg)
1304{ 1304{
1305 return video_usercopy(file, cmd, arg, stv680_do_ioctl); 1305 return video_usercopy(file, cmd, arg, stv680_do_ioctl);
@@ -1391,17 +1391,13 @@ static ssize_t stv680_read (struct file *file, char __user *buf,
1391 return realcount; 1391 return realcount;
1392} /* stv680_read */ 1392} /* stv680_read */
1393 1393
1394static const struct file_operations stv680_fops = { 1394static const struct v4l2_file_operations stv680_fops = {
1395 .owner = THIS_MODULE, 1395 .owner = THIS_MODULE,
1396 .open = stv_open, 1396 .open = stv_open,
1397 .release = stv_close, 1397 .release = stv_close,
1398 .read = stv680_read, 1398 .read = stv680_read,
1399 .mmap = stv680_mmap, 1399 .mmap = stv680_mmap,
1400 .ioctl = stv680_ioctl, 1400 .ioctl = stv680_ioctl,
1401#ifdef CONFIG_COMPAT
1402 .compat_ioctl = v4l_compat_ioctl32,
1403#endif
1404 .llseek = no_llseek,
1405}; 1401};
1406static struct video_device stv680_template = { 1402static struct video_device stv680_template = {
1407 .name = "STV0680 USB camera", 1403 .name = "STV0680 USB camera",
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);
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index 4602597ed8d1..53197a4e6b92 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -230,7 +230,7 @@ set_camera_power(struct vicam_camera *cam, int state)
230} 230}
231 231
232static int 232static int
233vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsigned long arg) 233vicam_ioctl(struct file *file, unsigned int ioctlnr, unsigned long arg)
234{ 234{
235 void __user *user_arg = (void __user *)arg; 235 void __user *user_arg = (void __user *)arg;
236 struct vicam_camera *cam = file->private_data; 236 struct vicam_camera *cam = file->private_data;
@@ -470,7 +470,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
470} 470}
471 471
472static int 472static int
473vicam_open(struct inode *inode, struct file *file) 473vicam_open(struct file *file)
474{ 474{
475 struct vicam_camera *cam = video_drvdata(file); 475 struct vicam_camera *cam = video_drvdata(file);
476 476
@@ -536,7 +536,7 @@ vicam_open(struct inode *inode, struct file *file)
536} 536}
537 537
538static int 538static int
539vicam_close(struct inode *inode, struct file *file) 539vicam_close(struct file *file)
540{ 540{
541 struct vicam_camera *cam = file->private_data; 541 struct vicam_camera *cam = file->private_data;
542 int open_count; 542 int open_count;
@@ -783,17 +783,13 @@ vicam_mmap(struct file *file, struct vm_area_struct *vma)
783 return 0; 783 return 0;
784} 784}
785 785
786static const struct file_operations vicam_fops = { 786static const struct v4l2_file_operations vicam_fops = {
787 .owner = THIS_MODULE, 787 .owner = THIS_MODULE,
788 .open = vicam_open, 788 .open = vicam_open,
789 .release = vicam_close, 789 .release = vicam_close,
790 .read = vicam_read, 790 .read = vicam_read,
791 .mmap = vicam_mmap, 791 .mmap = vicam_mmap,
792 .ioctl = vicam_ioctl, 792 .ioctl = vicam_ioctl,
793#ifdef CONFIG_COMPAT
794 .compat_ioctl = v4l_compat_ioctl32,
795#endif
796 .llseek = no_llseek,
797}; 793};
798 794
799static struct video_device vicam_template = { 795static struct video_device vicam_template = {
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 */
358static int usbvision_v4l2_open(struct inode *inode, struct file *file) 358static 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 */
435static int usbvision_v4l2_close(struct inode *inode, struct file *file) 435static 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 */
1181static int usbvision_radio_open(struct inode *inode, struct file *file) 1181static 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
1231static int usbvision_radio_close(struct inode *inode, struct file *file) 1231static 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 */
1269static int usbvision_vbi_open(struct inode *inode, struct file *file) 1269static int usbvision_vbi_open(struct file *file)
1270{ 1270{
1271 /* TODO */ 1271 /* TODO */
1272 return -ENODEV; 1272 return -ENODEV;
1273} 1273}
1274 1274
1275static int usbvision_vbi_close(struct inode *inode, struct file *file) 1275static 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
1288static int usbvision_vbi_ioctl(struct inode *inode, struct file *file, 1288static 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
1300static const struct file_operations usbvision_fops = { 1300static 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
1312static const struct v4l2_ioctl_ops usbvision_ioctl_ops = { 1310static 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
1358static const struct file_operations usbvision_radio_fops = { 1356static 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
1367static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { 1363static 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
1395static const struct file_operations usbvision_vbi_fops = { 1391static 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
1404static struct video_device usbvision_vbi_template= 1398static struct video_device usbvision_vbi_template=
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index afcc6934559e..df9e937626ef 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -406,7 +406,7 @@ static int uvc_has_privileges(struct uvc_fh *handle)
406 * V4L2 file operations 406 * V4L2 file operations
407 */ 407 */
408 408
409static int uvc_v4l2_open(struct inode *inode, struct file *file) 409static int uvc_v4l2_open(struct file *file)
410{ 410{
411 struct uvc_video_device *video; 411 struct uvc_video_device *video;
412 struct uvc_fh *handle; 412 struct uvc_fh *handle;
@@ -444,7 +444,7 @@ done:
444 return ret; 444 return ret;
445} 445}
446 446
447static int uvc_v4l2_release(struct inode *inode, struct file *file) 447static int uvc_v4l2_release(struct file *file)
448{ 448{
449 struct uvc_video_device *video = video_drvdata(file); 449 struct uvc_video_device *video = video_drvdata(file);
450 struct uvc_fh *handle = (struct uvc_fh *)file->private_data; 450 struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
@@ -996,7 +996,7 @@ static int uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
996 return ret; 996 return ret;
997} 997}
998 998
999static int uvc_v4l2_ioctl(struct inode *inode, struct file *file, 999static int uvc_v4l2_ioctl(struct file *file,
1000 unsigned int cmd, unsigned long arg) 1000 unsigned int cmd, unsigned long arg)
1001{ 1001{
1002 if (uvc_trace_param & UVC_TRACE_IOCTL) { 1002 if (uvc_trace_param & UVC_TRACE_IOCTL) {
@@ -1097,13 +1097,11 @@ static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait)
1097 return uvc_queue_poll(&video->queue, file, wait); 1097 return uvc_queue_poll(&video->queue, file, wait);
1098} 1098}
1099 1099
1100struct file_operations uvc_fops = { 1100const struct v4l2_file_operations uvc_fops = {
1101 .owner = THIS_MODULE, 1101 .owner = THIS_MODULE,
1102 .open = uvc_v4l2_open, 1102 .open = uvc_v4l2_open,
1103 .release = uvc_v4l2_release, 1103 .release = uvc_v4l2_release,
1104 .ioctl = uvc_v4l2_ioctl, 1104 .ioctl = uvc_v4l2_ioctl,
1105 .compat_ioctl = v4l_compat_ioctl32,
1106 .llseek = no_llseek,
1107 .read = uvc_v4l2_read, 1105 .read = uvc_v4l2_read,
1108 .mmap = uvc_v4l2_mmap, 1106 .mmap = uvc_v4l2_mmap,
1109 .poll = uvc_v4l2_poll, 1107 .poll = uvc_v4l2_poll,
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index 896b791ece15..bcf4361dc1bc 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -753,7 +753,7 @@ static inline int uvc_queue_streaming(struct uvc_video_queue *queue)
753} 753}
754 754
755/* V4L2 interface */ 755/* V4L2 interface */
756extern struct file_operations uvc_fops; 756extern const struct v4l2_file_operations uvc_fops;
757 757
758/* Video */ 758/* Video */
759extern int uvc_video_init(struct uvc_video_device *video); 759extern int uvc_video_init(struct uvc_video_device *video);
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c
index 26fdf1e4a2f9..b4f391431853 100644
--- a/drivers/media/video/v4l2-compat-ioctl32.c
+++ b/drivers/media/video/v4l2-compat-ioctl32.c
@@ -1072,12 +1072,7 @@ long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
1072 } 1072 }
1073 return ret; 1073 return ret;
1074} 1074}
1075#else
1076long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
1077{
1078 return -ENOIOCTLCMD;
1079}
1080#endif
1081EXPORT_SYMBOL_GPL(v4l_compat_ioctl32); 1075EXPORT_SYMBOL_GPL(v4l_compat_ioctl32);
1076#endif
1082 1077
1083MODULE_LICENSE("GPL"); 1078MODULE_LICENSE("GPL");
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 7ad6711ee327..000013448b60 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -31,6 +31,7 @@
31 31
32#include <media/v4l2-common.h> 32#include <media/v4l2-common.h>
33#include <media/v4l2-device.h> 33#include <media/v4l2-device.h>
34#include <media/v4l2-ioctl.h>
34 35
35#define VIDEO_NUM_DEVICES 256 36#define VIDEO_NUM_DEVICES 256
36#define VIDEO_NAME "video4linux" 37#define VIDEO_NAME "video4linux"
@@ -182,7 +183,7 @@ static int v4l2_ioctl(struct inode *inode, struct file *filp,
182 return -ENOTTY; 183 return -ENOTTY;
183 /* Allow ioctl to continue even if the device was unregistered. 184 /* Allow ioctl to continue even if the device was unregistered.
184 Things like dequeueing buffers might still be useful. */ 185 Things like dequeueing buffers might still be useful. */
185 return vdev->fops->ioctl(inode, filp, cmd, arg); 186 return vdev->fops->ioctl(filp, cmd, arg);
186} 187}
187 188
188static long v4l2_unlocked_ioctl(struct file *filp, 189static long v4l2_unlocked_ioctl(struct file *filp,
@@ -197,20 +198,6 @@ static long v4l2_unlocked_ioctl(struct file *filp,
197 return vdev->fops->unlocked_ioctl(filp, cmd, arg); 198 return vdev->fops->unlocked_ioctl(filp, cmd, arg);
198} 199}
199 200
200#ifdef CONFIG_COMPAT
201static long v4l2_compat_ioctl(struct file *filp,
202 unsigned int cmd, unsigned long arg)
203{
204 struct video_device *vdev = video_devdata(filp);
205
206 if (!vdev->fops->compat_ioctl)
207 return -ENOIOCTLCMD;
208 /* Allow ioctl to continue even if the device was unregistered.
209 Things like dequeueing buffers might still be useful. */
210 return vdev->fops->compat_ioctl(filp, cmd, arg);
211}
212#endif
213
214static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm) 201static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm)
215{ 202{
216 struct video_device *vdev = video_devdata(filp); 203 struct video_device *vdev = video_devdata(filp);
@@ -239,7 +226,7 @@ static int v4l2_open(struct inode *inode, struct file *filp)
239 /* and increase the device refcount */ 226 /* and increase the device refcount */
240 video_get(vdev); 227 video_get(vdev);
241 mutex_unlock(&videodev_lock); 228 mutex_unlock(&videodev_lock);
242 ret = vdev->fops->open(inode, filp); 229 ret = vdev->fops->open(filp);
243 /* decrease the refcount in case of an error */ 230 /* decrease the refcount in case of an error */
244 if (ret) 231 if (ret)
245 video_put(vdev); 232 video_put(vdev);
@@ -250,7 +237,7 @@ static int v4l2_open(struct inode *inode, struct file *filp)
250static int v4l2_release(struct inode *inode, struct file *filp) 237static int v4l2_release(struct inode *inode, struct file *filp)
251{ 238{
252 struct video_device *vdev = video_devdata(filp); 239 struct video_device *vdev = video_devdata(filp);
253 int ret = vdev->fops->release(inode, filp); 240 int ret = vdev->fops->release(filp);
254 241
255 /* decrease the refcount unconditionally since the release() 242 /* decrease the refcount unconditionally since the release()
256 return value is ignored. */ 243 return value is ignored. */
@@ -266,7 +253,7 @@ static const struct file_operations v4l2_unlocked_fops = {
266 .mmap = v4l2_mmap, 253 .mmap = v4l2_mmap,
267 .unlocked_ioctl = v4l2_unlocked_ioctl, 254 .unlocked_ioctl = v4l2_unlocked_ioctl,
268#ifdef CONFIG_COMPAT 255#ifdef CONFIG_COMPAT
269 .compat_ioctl = v4l2_compat_ioctl, 256 .compat_ioctl = v4l_compat_ioctl32,
270#endif 257#endif
271 .release = v4l2_release, 258 .release = v4l2_release,
272 .poll = v4l2_poll, 259 .poll = v4l2_poll,
@@ -281,7 +268,7 @@ static const struct file_operations v4l2_fops = {
281 .mmap = v4l2_mmap, 268 .mmap = v4l2_mmap,
282 .ioctl = v4l2_ioctl, 269 .ioctl = v4l2_ioctl,
283#ifdef CONFIG_COMPAT 270#ifdef CONFIG_COMPAT
284 .compat_ioctl = v4l2_compat_ioctl, 271 .compat_ioctl = v4l_compat_ioctl32,
285#endif 272#endif
286 .release = v4l2_release, 273 .release = v4l2_release,
287 .poll = v4l2_poll, 274 .poll = v4l2_poll,
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index b063381f4b3b..3b834f42e97b 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -1852,7 +1852,7 @@ static int __video_do_ioctl(struct file *file,
1852 return ret; 1852 return ret;
1853} 1853}
1854 1854
1855long __video_ioctl2(struct file *file, 1855int video_ioctl2(struct file *file,
1856 unsigned int cmd, unsigned long arg) 1856 unsigned int cmd, unsigned long arg)
1857{ 1857{
1858 char sbuf[128]; 1858 char sbuf[128];
@@ -1944,11 +1944,4 @@ out:
1944 kfree(mbuf); 1944 kfree(mbuf);
1945 return err; 1945 return err;
1946} 1946}
1947EXPORT_SYMBOL(__video_ioctl2);
1948
1949int video_ioctl2(struct inode *inode, struct file *file,
1950 unsigned int cmd, unsigned long arg)
1951{
1952 return __video_ioctl2(file, cmd, arg);
1953}
1954EXPORT_SYMBOL(video_ioctl2); 1947EXPORT_SYMBOL(video_ioctl2);
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
index a72a361daade..63863fa8d65f 100644
--- a/drivers/media/video/vino.c
+++ b/drivers/media/video/vino.c
@@ -4019,7 +4019,7 @@ out:
4019 4019
4020/* File operations */ 4020/* File operations */
4021 4021
4022static int vino_open(struct inode *inode, struct file *file) 4022static int vino_open(struct file *file)
4023{ 4023{
4024 struct vino_channel_settings *vcs = video_drvdata(file); 4024 struct vino_channel_settings *vcs = video_drvdata(file);
4025 int ret = 0; 4025 int ret = 0;
@@ -4050,7 +4050,7 @@ static int vino_open(struct inode *inode, struct file *file)
4050 return ret; 4050 return ret;
4051} 4051}
4052 4052
4053static int vino_close(struct inode *inode, struct file *file) 4053static int vino_close(struct file *file)
4054{ 4054{
4055 struct vino_channel_settings *vcs = video_drvdata(file); 4055 struct vino_channel_settings *vcs = video_drvdata(file);
4056 dprintk("close():\n"); 4056 dprintk("close():\n");
@@ -4343,7 +4343,7 @@ static int vino_do_ioctl(struct file *file, unsigned int cmd, void *arg)
4343 return 0; 4343 return 0;
4344} 4344}
4345 4345
4346static int vino_ioctl(struct inode *inode, struct file *file, 4346static int vino_ioctl(struct file *file,
4347 unsigned int cmd, unsigned long arg) 4347 unsigned int cmd, unsigned long arg)
4348{ 4348{
4349 struct vino_channel_settings *vcs = video_drvdata(file); 4349 struct vino_channel_settings *vcs = video_drvdata(file);
@@ -4364,14 +4364,13 @@ static int vino_ioctl(struct inode *inode, struct file *file,
4364/* __initdata */ 4364/* __initdata */
4365static int vino_init_stage; 4365static int vino_init_stage;
4366 4366
4367static const struct file_operations vino_fops = { 4367static const struct v4l2_file_operations vino_fops = {
4368 .owner = THIS_MODULE, 4368 .owner = THIS_MODULE,
4369 .open = vino_open, 4369 .open = vino_open,
4370 .release = vino_close, 4370 .release = vino_close,
4371 .ioctl = vino_ioctl, 4371 .ioctl = vino_ioctl,
4372 .mmap = vino_mmap, 4372 .mmap = vino_mmap,
4373 .poll = vino_poll, 4373 .poll = vino_poll,
4374 .llseek = no_llseek,
4375}; 4374};
4376 4375
4377static struct video_device v4l_device_template = { 4376static struct video_device v4l_device_template = {
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index e15e48f04be7..81d5aa5cf331 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1024,9 +1024,9 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
1024 File operations for the device 1024 File operations for the device
1025 ------------------------------------------------------------------*/ 1025 ------------------------------------------------------------------*/
1026 1026
1027static int vivi_open(struct inode *inode, struct file *file) 1027static int vivi_open(struct file *file)
1028{ 1028{
1029 int minor = iminor(inode); 1029 int minor = video_devdata(file)->minor;
1030 struct vivi_dev *dev; 1030 struct vivi_dev *dev;
1031 struct vivi_fh *fh = NULL; 1031 struct vivi_fh *fh = NULL;
1032 int i; 1032 int i;
@@ -1127,13 +1127,13 @@ vivi_poll(struct file *file, struct poll_table_struct *wait)
1127 return videobuf_poll_stream(file, q, wait); 1127 return videobuf_poll_stream(file, q, wait);
1128} 1128}
1129 1129
1130static int vivi_close(struct inode *inode, struct file *file) 1130static int vivi_close(struct file *file)
1131{ 1131{
1132 struct vivi_fh *fh = file->private_data; 1132 struct vivi_fh *fh = file->private_data;
1133 struct vivi_dev *dev = fh->dev; 1133 struct vivi_dev *dev = fh->dev;
1134 struct vivi_dmaqueue *vidq = &dev->vidq; 1134 struct vivi_dmaqueue *vidq = &dev->vidq;
1135 1135
1136 int minor = iminor(inode); 1136 int minor = video_devdata(file)->minor;
1137 1137
1138 vivi_stop_thread(vidq); 1138 vivi_stop_thread(vidq);
1139 videobuf_stop(&fh->vb_vidq); 1139 videobuf_stop(&fh->vb_vidq);
@@ -1195,16 +1195,14 @@ static int vivi_mmap(struct file *file, struct vm_area_struct *vma)
1195 return ret; 1195 return ret;
1196} 1196}
1197 1197
1198static const struct file_operations vivi_fops = { 1198static const struct v4l2_file_operations vivi_fops = {
1199 .owner = THIS_MODULE, 1199 .owner = THIS_MODULE,
1200 .open = vivi_open, 1200 .open = vivi_open,
1201 .release = vivi_close, 1201 .release = vivi_close,
1202 .read = vivi_read, 1202 .read = vivi_read,
1203 .poll = vivi_poll, 1203 .poll = vivi_poll,
1204 .ioctl = video_ioctl2, /* V4L2 ioctl handler */ 1204 .ioctl = video_ioctl2, /* V4L2 ioctl handler */
1205 .compat_ioctl = v4l_compat_ioctl32,
1206 .mmap = vivi_mmap, 1205 .mmap = vivi_mmap,
1207 .llseek = no_llseek,
1208}; 1206};
1209 1207
1210static const struct v4l2_ioctl_ops vivi_ioctl_ops = { 1208static const struct v4l2_ioctl_ops vivi_ioctl_ops = {
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index 56c570c267ea..91500f57442a 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -180,19 +180,19 @@ static int w9966_i2c_wbyte(struct w9966_dev* cam, int data);
180static int w9966_i2c_rbyte(struct w9966_dev* cam); 180static int w9966_i2c_rbyte(struct w9966_dev* cam);
181#endif 181#endif
182 182
183static int w9966_v4l_ioctl(struct inode *inode, struct file *file, 183static int w9966_v4l_ioctl(struct file *file,
184 unsigned int cmd, unsigned long arg); 184 unsigned int cmd, unsigned long arg);
185static ssize_t w9966_v4l_read(struct file *file, char __user *buf, 185static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
186 size_t count, loff_t *ppos); 186 size_t count, loff_t *ppos);
187 187
188static int w9966_exclusive_open(struct inode *inode, struct file *file) 188static int w9966_exclusive_open(struct file *file)
189{ 189{
190 struct w9966_dev *cam = video_drvdata(file); 190 struct w9966_dev *cam = video_drvdata(file);
191 191
192 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; 192 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0;
193} 193}
194 194
195static int w9966_exclusive_release(struct inode *inode, struct file *file) 195static int w9966_exclusive_release(struct file *file)
196{ 196{
197 struct w9966_dev *cam = video_drvdata(file); 197 struct w9966_dev *cam = video_drvdata(file);
198 198
@@ -200,16 +200,12 @@ static int w9966_exclusive_release(struct inode *inode, struct file *file)
200 return 0; 200 return 0;
201} 201}
202 202
203static const struct file_operations w9966_fops = { 203static const struct v4l2_file_operations w9966_fops = {
204 .owner = THIS_MODULE, 204 .owner = THIS_MODULE,
205 .open = w9966_exclusive_open, 205 .open = w9966_exclusive_open,
206 .release = w9966_exclusive_release, 206 .release = w9966_exclusive_release,
207 .ioctl = w9966_v4l_ioctl, 207 .ioctl = w9966_v4l_ioctl,
208#ifdef CONFIG_COMPAT
209 .compat_ioctl = v4l_compat_ioctl32,
210#endif
211 .read = w9966_v4l_read, 208 .read = w9966_v4l_read,
212 .llseek = no_llseek,
213}; 209};
214static struct video_device w9966_template = { 210static struct video_device w9966_template = {
215 .name = W9966_DRIVERNAME, 211 .name = W9966_DRIVERNAME,
@@ -877,7 +873,7 @@ static int w9966_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg)
877 return 0; 873 return 0;
878} 874}
879 875
880static int w9966_v4l_ioctl(struct inode *inode, struct file *file, 876static int w9966_v4l_ioctl(struct file *file,
881 unsigned int cmd, unsigned long arg) 877 unsigned int cmd, unsigned long arg)
882{ 878{
883 return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl); 879 return video_usercopy(file, cmd, arg, w9966_v4l_do_ioctl);
diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
index 4dfb43bd1846..159b4edd69e0 100644
--- a/drivers/media/video/w9968cf.c
+++ b/drivers/media/video/w9968cf.c
@@ -399,13 +399,13 @@ MODULE_PARM_DESC(specific_debug,
399 ****************************************************************************/ 399 ****************************************************************************/
400 400
401/* Video4linux interface */ 401/* Video4linux interface */
402static const struct file_operations w9968cf_fops; 402static const struct v4l2_file_operations w9968cf_fops;
403static int w9968cf_open(struct inode*, struct file*); 403static int w9968cf_open(struct file *);
404static int w9968cf_release(struct inode*, struct file*); 404static int w9968cf_release(struct file *);
405static int w9968cf_mmap(struct file*, struct vm_area_struct*); 405static int w9968cf_mmap(struct file *, struct vm_area_struct *);
406static int w9968cf_ioctl(struct inode*, struct file*, unsigned, unsigned long); 406static int w9968cf_ioctl(struct file *, unsigned, unsigned long);
407static ssize_t w9968cf_read(struct file*, char __user *, size_t, loff_t*); 407static ssize_t w9968cf_read(struct file *, char __user *, size_t, loff_t *);
408static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int, 408static int w9968cf_v4l_ioctl(struct file *, unsigned int,
409 void __user *); 409 void __user *);
410 410
411/* USB-specific */ 411/* USB-specific */
@@ -2662,7 +2662,7 @@ static void w9968cf_release_resources(struct w9968cf_device* cam)
2662 * Video4Linux interface * 2662 * Video4Linux interface *
2663 ****************************************************************************/ 2663 ****************************************************************************/
2664 2664
2665static int w9968cf_open(struct inode* inode, struct file* filp) 2665static int w9968cf_open(struct file *filp)
2666{ 2666{
2667 struct w9968cf_device* cam; 2667 struct w9968cf_device* cam;
2668 int err; 2668 int err;
@@ -2748,7 +2748,7 @@ deallocate_memory:
2748} 2748}
2749 2749
2750 2750
2751static int w9968cf_release(struct inode* inode, struct file* filp) 2751static int w9968cf_release(struct file *filp)
2752{ 2752{
2753 struct w9968cf_device* cam; 2753 struct w9968cf_device* cam;
2754 2754
@@ -2886,7 +2886,7 @@ static int w9968cf_mmap(struct file* filp, struct vm_area_struct *vma)
2886 2886
2887 2887
2888static int 2888static int
2889w9968cf_ioctl(struct inode* inode, struct file* filp, 2889w9968cf_ioctl(struct file *filp,
2890 unsigned int cmd, unsigned long arg) 2890 unsigned int cmd, unsigned long arg)
2891{ 2891{
2892 struct w9968cf_device* cam; 2892 struct w9968cf_device* cam;
@@ -2909,15 +2909,15 @@ w9968cf_ioctl(struct inode* inode, struct file* filp,
2909 return -EIO; 2909 return -EIO;
2910 } 2910 }
2911 2911
2912 err = w9968cf_v4l_ioctl(inode, filp, cmd, (void __user *)arg); 2912 err = w9968cf_v4l_ioctl(filp, cmd, (void __user *)arg);
2913 2913
2914 mutex_unlock(&cam->fileop_mutex); 2914 mutex_unlock(&cam->fileop_mutex);
2915 return err; 2915 return err;
2916} 2916}
2917 2917
2918 2918
2919static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp, 2919static int w9968cf_v4l_ioctl(struct file *filp,
2920 unsigned int cmd, void __user * arg) 2920 unsigned int cmd, void __user *arg)
2921{ 2921{
2922 struct w9968cf_device* cam; 2922 struct w9968cf_device* cam;
2923 const char* v4l1_ioctls[] = { 2923 const char* v4l1_ioctls[] = {
@@ -3456,17 +3456,13 @@ ioctl_fail:
3456} 3456}
3457 3457
3458 3458
3459static const struct file_operations w9968cf_fops = { 3459static const struct v4l2_file_operations w9968cf_fops = {
3460 .owner = THIS_MODULE, 3460 .owner = THIS_MODULE,
3461 .open = w9968cf_open, 3461 .open = w9968cf_open,
3462 .release = w9968cf_release, 3462 .release = w9968cf_release,
3463 .read = w9968cf_read, 3463 .read = w9968cf_read,
3464 .ioctl = w9968cf_ioctl, 3464 .ioctl = w9968cf_ioctl,
3465#ifdef CONFIG_COMPAT
3466 .compat_ioctl = v4l_compat_ioctl32,
3467#endif
3468 .mmap = w9968cf_mmap, 3465 .mmap = w9968cf_mmap,
3469 .llseek = no_llseek,
3470}; 3466};
3471 3467
3472 3468
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index 9d00e6056491..46590f63f0eb 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -649,7 +649,7 @@ static void zc0301_release_resources(struct kref *kref)
649} 649}
650 650
651 651
652static int zc0301_open(struct inode* inode, struct file* filp) 652static int zc0301_open(struct file *filp)
653{ 653{
654 struct zc0301_device* cam; 654 struct zc0301_device* cam;
655 int err = 0; 655 int err = 0;
@@ -733,7 +733,7 @@ out:
733} 733}
734 734
735 735
736static int zc0301_release(struct inode* inode, struct file* filp) 736static int zc0301_release(struct file *filp)
737{ 737{
738 struct zc0301_device* cam; 738 struct zc0301_device* cam;
739 739
@@ -1793,8 +1793,8 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg)
1793} 1793}
1794 1794
1795 1795
1796static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, 1796static int zc0301_ioctl_v4l2(struct file *filp,
1797 unsigned int cmd, void __user * arg) 1797 unsigned int cmd, void __user *arg)
1798{ 1798{
1799 struct zc0301_device *cam = video_drvdata(filp); 1799 struct zc0301_device *cam = video_drvdata(filp);
1800 1800
@@ -1888,7 +1888,7 @@ static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
1888} 1888}
1889 1889
1890 1890
1891static int zc0301_ioctl(struct inode* inode, struct file* filp, 1891static int zc0301_ioctl(struct file *filp,
1892 unsigned int cmd, unsigned long arg) 1892 unsigned int cmd, unsigned long arg)
1893{ 1893{
1894 struct zc0301_device *cam = video_drvdata(filp); 1894 struct zc0301_device *cam = video_drvdata(filp);
@@ -1912,7 +1912,7 @@ static int zc0301_ioctl(struct inode* inode, struct file* filp,
1912 1912
1913 V4LDBG(3, "zc0301", cmd); 1913 V4LDBG(3, "zc0301", cmd);
1914 1914
1915 err = zc0301_ioctl_v4l2(inode, filp, cmd, (void __user *)arg); 1915 err = zc0301_ioctl_v4l2(filp, cmd, (void __user *)arg);
1916 1916
1917 mutex_unlock(&cam->fileop_mutex); 1917 mutex_unlock(&cam->fileop_mutex);
1918 1918
@@ -1920,18 +1920,14 @@ static int zc0301_ioctl(struct inode* inode, struct file* filp,
1920} 1920}
1921 1921
1922 1922
1923static const struct file_operations zc0301_fops = { 1923static const struct v4l2_file_operations zc0301_fops = {
1924 .owner = THIS_MODULE, 1924 .owner = THIS_MODULE,
1925 .open = zc0301_open, 1925 .open = zc0301_open,
1926 .release = zc0301_release, 1926 .release = zc0301_release,
1927 .ioctl = zc0301_ioctl, 1927 .ioctl = zc0301_ioctl,
1928#ifdef CONFIG_COMPAT
1929 .compat_ioctl = v4l_compat_ioctl32,
1930#endif
1931 .read = zc0301_read, 1928 .read = zc0301_read,
1932 .poll = zc0301_poll, 1929 .poll = zc0301_poll,
1933 .mmap = zc0301_mmap, 1930 .mmap = zc0301_mmap,
1934 .llseek = no_llseek,
1935}; 1931};
1936 1932
1937/*****************************************************************************/ 1933/*****************************************************************************/
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c
index 00b97d97aeaa..ce4a5e5f9d25 100644
--- a/drivers/media/video/zoran/zoran_driver.c
+++ b/drivers/media/video/zoran/zoran_driver.c
@@ -1197,10 +1197,9 @@ zoran_close_end_session (struct file *file)
1197 */ 1197 */
1198 1198
1199static int 1199static int
1200zoran_open (struct inode *inode, 1200zoran_open(struct file *file)
1201 struct file *file)
1202{ 1201{
1203 unsigned int minor = iminor(inode); 1202 unsigned int minor = video_devdata(file)->minor;
1204 struct zoran *zr = NULL; 1203 struct zoran *zr = NULL;
1205 struct zoran_fh *fh; 1204 struct zoran_fh *fh;
1206 int i, res, first_open = 0, have_module_locks = 0; 1205 int i, res, first_open = 0, have_module_locks = 0;
@@ -1340,8 +1339,7 @@ open_unlock_and_return:
1340} 1339}
1341 1340
1342static int 1341static int
1343zoran_close (struct inode *inode, 1342zoran_close(struct file *file)
1344 struct file *file)
1345{ 1343{
1346 struct zoran_fh *fh = file->private_data; 1344 struct zoran_fh *fh = file->private_data;
1347 struct zoran *zr = fh->zr; 1345 struct zoran *zr = fh->zr;
@@ -4192,10 +4190,9 @@ static int zoran_do_ioctl(struct file *file, unsigned int cmd, void *arg)
4192 4190
4193 4191
4194static int 4192static int
4195zoran_ioctl (struct inode *inode, 4193zoran_ioctl(struct file *file,
4196 struct file *file, 4194 unsigned int cmd,
4197 unsigned int cmd, 4195 unsigned long arg)
4198 unsigned long arg)
4199{ 4196{
4200 return video_usercopy(file, cmd, arg, zoran_do_ioctl); 4197 return video_usercopy(file, cmd, arg, zoran_do_ioctl);
4201} 4198}
@@ -4620,15 +4617,11 @@ zoran_mmap (struct file *file,
4620 return 0; 4617 return 0;
4621} 4618}
4622 4619
4623static const struct file_operations zoran_fops = { 4620static const struct v4l2_file_operations zoran_fops = {
4624 .owner = THIS_MODULE, 4621 .owner = THIS_MODULE,
4625 .open = zoran_open, 4622 .open = zoran_open,
4626 .release = zoran_close, 4623 .release = zoran_close,
4627 .ioctl = zoran_ioctl, 4624 .ioctl = zoran_ioctl,
4628#ifdef CONFIG_COMPAT
4629 .compat_ioctl = v4l_compat_ioctl32,
4630#endif
4631 .llseek = no_llseek,
4632 .read = zoran_read, 4625 .read = zoran_read,
4633 .write = zoran_write, 4626 .write = zoran_write,
4634 .mmap = zoran_mmap, 4627 .mmap = zoran_mmap,
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index a1d81ed44c7c..bf68ed9c5eb6 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -634,7 +634,7 @@ static int zr364xx_vidioc_streamoff(struct file *file, void *priv,
634 634
635 635
636/* open the camera */ 636/* open the camera */
637static int zr364xx_open(struct inode *inode, struct file *file) 637static int zr364xx_open(struct file *file)
638{ 638{
639 struct video_device *vdev = video_devdata(file); 639 struct video_device *vdev = video_devdata(file);
640 struct zr364xx_camera *cam = video_get_drvdata(vdev); 640 struct zr364xx_camera *cam = video_get_drvdata(vdev);
@@ -688,7 +688,7 @@ out:
688 688
689 689
690/* release the camera */ 690/* release the camera */
691static int zr364xx_release(struct inode *inode, struct file *file) 691static int zr364xx_release(struct file *file)
692{ 692{
693 struct video_device *vdev = video_devdata(file); 693 struct video_device *vdev = video_devdata(file);
694 struct zr364xx_camera *cam; 694 struct zr364xx_camera *cam;
@@ -761,14 +761,13 @@ static int zr364xx_mmap(struct file *file, struct vm_area_struct *vma)
761} 761}
762 762
763 763
764static const struct file_operations zr364xx_fops = { 764static const struct v4l2_file_operations zr364xx_fops = {
765 .owner = THIS_MODULE, 765 .owner = THIS_MODULE,
766 .open = zr364xx_open, 766 .open = zr364xx_open,
767 .release = zr364xx_release, 767 .release = zr364xx_release,
768 .read = zr364xx_read, 768 .read = zr364xx_read,
769 .mmap = zr364xx_mmap, 769 .mmap = zr364xx_mmap,
770 .ioctl = video_ioctl2, 770 .ioctl = video_ioctl2,
771 .llseek = no_llseek,
772}; 771};
773 772
774static const struct v4l2_ioctl_ops zr364xx_ioctl_ops = { 773static const struct v4l2_ioctl_ops zr364xx_ioctl_ops = {