]> git.neil.brown.name Git - history.git/commitdiff
adapt v4l usb cam drivers to 2.4.8-pre1 videodev fixes.
authorGerd Knorr <kraxel@bytesex.org>
Mon, 8 Apr 2002 13:32:47 +0000 (15:32 +0200)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 8 Apr 2002 13:32:47 +0000 (15:32 +0200)
drivers/usb/media/dsbr100.c
drivers/usb/media/ov511.c
drivers/usb/media/pwc-if.c
drivers/usb/media/se401.c
drivers/usb/media/stv680.c
drivers/usb/media/vicam.c

index 18233946e93324a262d9fea9aa7d2105725d3fec..ce61bfcbda8b935c007cb3c388c4cc2c3a3094ed 100644 (file)
@@ -82,7 +82,7 @@ static void *usb_dsbr100_probe(struct usb_device *dev, unsigned int ifnum,
                         const struct usb_device_id *id);
 static void usb_dsbr100_disconnect(struct usb_device *dev, void *ptr);
 static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
-                            unsigned int cmd, void *arg);
+                            unsigned int cmd, unsigned long arg);
 static int usb_dsbr100_open(struct inode *inode, struct file *file);
 static int usb_dsbr100_close(struct inode *inode, struct file *file);
 
@@ -103,7 +103,7 @@ static struct file_operations usb_dsbr100_fops = {
        owner:          THIS_MODULE,
        open:           usb_dsbr100_open,
        release:        usb_dsbr100_close,
-       ioctl:          video_generic_ioctl,
+       ioctl:          usb_dsbr100_ioctl,
        llseek:         no_llseek,
 };
 static struct video_device usb_dsbr100_radio=
@@ -113,7 +113,6 @@ static struct video_device usb_dsbr100_radio=
        type:           VID_TYPE_TUNER,
        hardware:       VID_HARDWARE_AZTECH,
        fops:           &usb_dsbr100_fops,
-       kernel_ioctl:   usb_dsbr100_ioctl,
 };
 
 static int users = 0;
@@ -212,8 +211,8 @@ static void usb_dsbr100_disconnect(struct usb_device *dev, void *ptr)
        unlock_kernel();
 }
 
-static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
-                            unsigned int cmd, void *arg)
+static int usb_dsbr100_do_ioctl(struct inode *inode, struct file *file,
+                               unsigned int cmd, void *arg)
 {
        struct video_device *dev = video_devdata(file);
        usb_dsbr100 *radio=dev->priv;
@@ -299,6 +298,11 @@ static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
        }
 }
 
+static int usb_dsbr100_ioctl(struct inode *inode, struct file *file,
+                            unsigned int cmd, unsigned long arg)
+{
+       return video_usercopy(inode, file, cmd, arg, usb_dsbr100_do_ioctl);
+}
 
 static int usb_dsbr100_open(struct inode *inode, struct file *file)
 {
index be79476373d7b8d226fc9eaabe2a12b123efb1a0..02b305c8eedeac09f4827b2c2d38b271b1362c12 100644 (file)
@@ -4555,9 +4555,11 @@ ov51x_v4l1_close(struct inode *inode, struct file *file)
 
 /* Do not call this function directly! */
 static int 
-ov51x_v4l1_ioctl_internal(struct usb_ov511 *ov, unsigned int cmd,
-                         void *arg)
+ov51x_v4l1_ioctl_internal(struct inode *inode, struct file *file,
+                         unsigned int cmd, void *arg)
 {
+       struct video_device *vdev = file->private_data;
+       struct usb_ov511 *ov = vdev->priv;
        PDEBUG(5, "IOCtl: 0x%X", cmd);
 
        if (!ov->dev)
@@ -5067,7 +5069,7 @@ redo:
 
 static int 
 ov51x_v4l1_ioctl(struct inode *inode, struct file *file,
-                unsigned int cmd, void *arg)
+                unsigned int cmd, unsigned long arg)
 {
        struct video_device *vdev = file->private_data;
        struct usb_ov511 *ov = vdev->priv;
@@ -5076,7 +5078,7 @@ ov51x_v4l1_ioctl(struct inode *inode, struct file *file,
        if (down_interruptible(&ov->lock))
                return -EINTR;
 
-       rc = ov51x_v4l1_ioctl_internal(ov, cmd, arg);
+       rc = video_usercopy(inode, file, cmd, arg, ov51x_v4l1_ioctl_internal);
 
        up(&ov->lock);
        return rc;
@@ -5284,7 +5286,7 @@ static struct file_operations ov511_fops = {
        release:        ov51x_v4l1_close,
        read:           ov51x_v4l1_read,
        mmap:           ov51x_v4l1_mmap,
-       ioctl:          video_generic_ioctl,
+       ioctl:          ov51x_v4l1_ioctl,
        llseek:         no_llseek,
 };
 
@@ -5294,7 +5296,6 @@ static struct video_device vdev_template = {
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_OV511,
        fops:           &ov511_fops,
-       kernel_ioctl:   ov51x_v4l1_ioctl,
 };
 
 #if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
index dd81ac1ce24a47c6b9b27b14a5d879b06ea97c30..915363e95ece11e7d12cf9b8cdef60b9d39e2b88 100644 (file)
@@ -126,7 +126,7 @@ static int pwc_video_read(struct file *file, char *buf,
                          size_t count, loff_t *ppos);
 static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
 static int  pwc_video_ioctl(struct inode *inode, struct file *file,
-                           unsigned int ioctlnr, void *arg);
+                           unsigned int ioctlnr, unsigned long arg);
 static int  pwc_video_mmap(struct file *file, struct vm_area_struct *vma);
 
 static struct file_operations pwc_fops = {
@@ -136,7 +136,7 @@ static struct file_operations pwc_fops = {
        read:           pwc_video_read,
        poll:           pwc_video_poll,
        mmap:           pwc_video_mmap,
-       ioctl:          video_generic_ioctl,
+       ioctl:          pwc_video_ioctl,
        llseek:         no_llseek,
 };
 static struct video_device pwc_template = {
@@ -145,7 +145,6 @@ static struct video_device pwc_template = {
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_PWC,
        fops:           &pwc_fops,
-       kernel_ioctl:   pwc_video_ioctl,
 };
 
 /***************************************************************************/
@@ -1171,8 +1170,8 @@ static unsigned int pwc_video_poll(struct file *file, poll_table *wait)
        return 0;
 }
         
-static int pwc_video_ioctl(struct inode *inode, struct file *file,
-                          unsigned int cmd, void *arg)
+static int pwc_video_do_ioctl(struct inode *inode, struct file *file,
+                             unsigned int cmd, void *arg)
 {
        struct video_device *vdev = file->private_data;
        struct pwc_device *pdev;
@@ -1494,6 +1493,13 @@ static int pwc_video_ioctl(struct inode *inode, struct file *file,
        return 0;
 }      
 
+static int pwc_video_ioctl(struct inode *inode, struct file *file,
+                          unsigned int cmd, unsigned long arg)
+{
+       return video_usercopy(inode, file, cmd, arg, pwc_video_do_ioctl);
+}
+
+
 static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct video_device *vdev = file->private_data;
index 8059a6be92969c0dafdb863549012a2f31006511..229098a03934bd9af8955b3558816f7dcdc1ef26 100644 (file)
@@ -1046,8 +1046,8 @@ static int se401_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-static int se401_ioctl(struct inode *inode, struct file *file,
-                      unsigned int cmd, void *arg)
+static int se401_do_ioctl(struct inode *inode, struct file *file,
+                         unsigned int cmd, void *arg)
 {
        struct video_device *vdev = file->private_data;
         struct usb_se401 *se401 = (struct usb_se401 *)vdev;
@@ -1210,6 +1210,12 @@ static int se401_ioctl(struct inode *inode, struct file *file,
         return 0;
 }
 
+static int se401_ioctl(struct inode *inode, struct file *file,
+                      unsigned int cmd, unsigned long arg)
+{
+       return video_usercopy(inode, file, cmd, arg, se401_do_ioctl);
+}
+
 static int se401_read(struct file *file, char *buf,
                     size_t count, loff_t *ppos)
 {
@@ -1294,7 +1300,7 @@ static struct file_operations se401_fops = {
         release:        se401_close,
         read:           se401_read,
         mmap:           se401_mmap,
-       ioctl:          video_generic_ioctl,
+       ioctl:          se401_ioctl,
        llseek:         no_llseek,
 };
 static struct video_device se401_template = {
@@ -1303,7 +1309,6 @@ static struct video_device se401_template = {
         type:           VID_TYPE_CAPTURE,
         hardware:       VID_HARDWARE_SE401,
        fops:           &se401_fops,
-        kernel_ioctl:   se401_ioctl,
 };
 
 
index 7da7bdf4ccfb5257e1a57a2b75e7ba762d6196d8..b2b7a5bb507069fe9b5e00dad7cbe70712df0688 100644 (file)
@@ -1171,8 +1171,8 @@ static int stv_close (struct inode *inode, struct file *file)
        return 0;
 }
 
-static int stv680_ioctl (struct inode *inode, struct file *file,
-                        unsigned int cmd, void *arg)
+static int stv680_do_ioctl (struct inode *inode, struct file *file,
+                           unsigned int cmd, void *arg)
 {
        struct video_device *vdev = file->private_data;
        struct usb_stv *stv680 = (struct usb_stv *) vdev;
@@ -1342,6 +1342,12 @@ static int stv680_ioctl (struct inode *inode, struct file *file,
        return 0;
 }
 
+static int stv680_ioctl(struct inode *inode, struct file *file,
+                       unsigned int cmd, unsigned long arg)
+{
+       return video_usercopy(inode, file, cmd, arg, stv680_do_ioctl);
+}
+
 static int stv680_mmap (struct file *file, struct vm_area_struct *vma)
 {
        struct video_device *dev = file->private_data;
@@ -1434,7 +1440,7 @@ static struct file_operations stv680_fops = {
        release:        stv_close,
        read:           stv680_read,
        mmap:           stv680_mmap,
-       ioctl:          video_generic_ioctl,
+       ioctl:          stv680_ioctl,
        llseek:         no_llseek,
 };
 static struct video_device stv680_template = {
@@ -1443,7 +1449,6 @@ static struct video_device stv680_template = {
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_SE401,
        fops:           &stv680_fops,
-       kernel_ioctl:   stv680_ioctl,
 };
 
 static void *__devinit stv680_probe (struct usb_device *dev, unsigned int ifnum, const struct usb_device_id *id)
index 03ffaed91e73ad00cc7e9afdddb8f511be7b8084..bed0fa5caeb2458e6c38f95b0d846c57854a5add 100644 (file)
@@ -483,8 +483,8 @@ static int vicam_v4l_read(struct file *file, char *user_buf,
        return buflen;
 }
 
-static int vicam_v4l_ioctl(struct inode *inode, struct file *file,
-                          unsigned int cmd, void *arg)
+static int vicam_v4l_do_ioctl(struct inode *inode, struct file *file,
+                             unsigned int cmd, void *arg)
 {
        struct video_device *vdev = file->private_data;
        struct usb_vicam *vicam = (struct usb_vicam *)vdev;
@@ -593,6 +593,12 @@ static int vicam_v4l_ioctl(struct inode *inode, struct file *file,
         return ret;
 }
 
+static int vicam_v4l_ioctl(struct inode *inode, struct file *file,
+                          unsigned int cmd, unsigned long arg)
+{
+       return video_usercopy(inode, file, cmd, arg, vicam_v4l_do_ioctl);
+}
+
 static int vicam_v4l_mmap(struct file *file, struct vm_area_struct *vma)
 {
        struct video_device *vdev = file->private_data;
@@ -639,7 +645,7 @@ static struct file_operations vicam_fops = {
        release:        vicam_v4l_close,
        read:           vicam_v4l_read,
        mmap:           vicam_v4l_mmap,
-       ioctl:          video_generic_ioctl,
+       ioctl:          vicam_v4l_ioctl,
        llseek:         no_llseek,
 };
 static struct video_device vicam_template = {
@@ -648,7 +654,6 @@ static struct video_device vicam_template = {
        type:           VID_TYPE_CAPTURE,
        hardware:       VID_HARDWARE_SE401, /* need to ask for own id */
        fops:           &vicam_fops,
-       kernel_ioctl:   vicam_v4l_ioctl,
 };
 
 /******************************************************************************