]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/meye.c
Merge branch 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-omap-h63xx.git] / drivers / media / video / meye.c
index 102a5b9cfd121698daab49f9d72002335da26316..b76e33d5c867bad4430035ac952765497fc128ee 100644 (file)
@@ -841,23 +841,18 @@ again:
 /* video4linux integration                                                  */
 /****************************************************************************/
 
-static int meye_open(struct inode *inode, struct file *file)
+static int meye_open(struct file *file)
 {
-       int i, err;
+       int i;
 
-       lock_kernel();
-       err = video_exclusive_open(inode, file);
-       if (err < 0) {
-               unlock_kernel();
-               return err;
-       }
+       if (test_and_set_bit(0, &meye.in_use))
+               return -EBUSY;
 
        mchip_hic_stop();
 
        if (mchip_dma_alloc()) {
                printk(KERN_ERR "meye: mchip framebuffer allocation failed\n");
-               video_exclusive_release(inode, file);
-               unlock_kernel();
+               clear_bit(0, &meye.in_use);
                return -ENOBUFS;
        }
 
@@ -865,15 +860,14 @@ static int meye_open(struct inode *inode, struct file *file)
                meye.grab_buffer[i].state = MEYE_BUF_UNUSED;
        kfifo_reset(meye.grabq);
        kfifo_reset(meye.doneq);
-       unlock_kernel();
        return 0;
 }
 
-static int meye_release(struct inode *inode, struct file *file)
+static int meye_release(struct file *file)
 {
        mchip_hic_stop();
        mchip_dma_free();
-       video_exclusive_release(inode, file);
+       clear_bit(0, &meye.in_use);
        return 0;
 }
 
@@ -1583,7 +1577,7 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i)
        return 0;
 }
 
-static int vidioc_default(struct file *file, void *fh, int cmd, void *arg)
+static long vidioc_default(struct file *file, void *fh, int cmd, void *arg)
 {
        switch (cmd) {
        case MEYEIOC_G_PARAMS:
@@ -1690,17 +1684,13 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static const struct file_operations meye_fops = {
+static const struct v4l2_file_operations meye_fops = {
        .owner          = THIS_MODULE,
        .open           = meye_open,
        .release        = meye_release,
        .mmap           = meye_mmap,
        .ioctl          = video_ioctl2,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = v4l_compat_ioctl32,
-#endif
        .poll           = meye_poll,
-       .llseek         = no_llseek,
 };
 
 static const struct v4l2_ioctl_ops meye_ioctl_ops = {