diff options
Diffstat (limited to 'drivers/media/video/meye.c')
-rw-r--r-- | drivers/media/video/meye.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c index a9ef780..6418f4a 100644 --- a/drivers/media/video/meye.c +++ b/drivers/media/video/meye.c @@ -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"); |