]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/meye.c
V4L/DVB (9120): gspca: sd_desc->start returns a value and static functions in m5602.
[linux-2.6-omap-h63xx.git] / drivers / media / video / meye.c
index 7c8ef6ac6c39cf646a9cfc3d4223d8bea51e48de..6418f4a78f2a86afc716ff9e6e4d377ceceb434d 100644 (file)
@@ -843,17 +843,16 @@ again:
 
 static int meye_open(struct inode *inode, struct file *file)
 {
-       int i, err;
+       int i;
 
-       err = video_exclusive_open(inode, file);
-       if (err < 0)
-               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);
+               clear_bit(0, &meye.in_use);
                return -ENOBUFS;
        }
 
@@ -868,7 +867,7 @@ static int meye_release(struct inode *inode, struct file *file)
 {
        mchip_hic_stop();
        mchip_dma_free();
-       video_exclusive_release(inode, file);
+       clear_bit(0, &meye.in_use);
        return 0;
 }
 
@@ -1774,6 +1773,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
                goto outnotdev;
        }
 
+       ret = -ENOMEM;
        meye.mchip_dev = pcidev;
        meye.video_dev = video_device_alloc();
        if (!meye.video_dev) {
@@ -1781,7 +1781,6 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
                goto outnotdev;
        }
 
-       ret = -ENOMEM;
        meye.grab_temp = vmalloc(MCHIP_NB_PAGES_MJPEG * PAGE_SIZE);
        if (!meye.grab_temp) {
                printk(KERN_ERR "meye: grab buffer allocation failed\n");
@@ -1806,6 +1805,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
        memcpy(meye.video_dev, &meye_template, sizeof(meye_template));
        meye.video_dev->parent = &meye.mchip_dev->dev;
 
+       ret = -EIO;
        if ((ret = sony_pic_camera_command(SONY_PIC_COMMAND_SETCAMERA, 1))) {
                printk(KERN_ERR "meye: unable to power on the camera\n");
                printk(KERN_ERR "meye: did you enable the camera in "
@@ -1813,7 +1813,6 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
                goto outsonypienable;
        }
 
-       ret = -EIO;
        if ((ret = pci_enable_device(meye.mchip_dev))) {
                printk(KERN_ERR "meye: pci_enable_device failed\n");
                goto outenabledev;