aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/meye.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/meye.c')
-rw-r--r--drivers/media/video/meye.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index a9ef7802eb5f..6418f4a78f2a 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -843,17 +843,16 @@ again:
843 843
844static int meye_open(struct inode *inode, struct file *file) 844static int meye_open(struct inode *inode, struct file *file)
845{ 845{
846 int i, err; 846 int i;
847 847
848 err = video_exclusive_open(inode, file); 848 if (test_and_set_bit(0, &meye.in_use))
849 if (err < 0) 849 return -EBUSY;
850 return err;
851 850
852 mchip_hic_stop(); 851 mchip_hic_stop();
853 852
854 if (mchip_dma_alloc()) { 853 if (mchip_dma_alloc()) {
855 printk(KERN_ERR "meye: mchip framebuffer allocation failed\n"); 854 printk(KERN_ERR "meye: mchip framebuffer allocation failed\n");
856 video_exclusive_release(inode, file); 855 clear_bit(0, &meye.in_use);
857 return -ENOBUFS; 856 return -ENOBUFS;
858 } 857 }
859 858
@@ -868,7 +867,7 @@ static int meye_release(struct inode *inode, struct file *file)
868{ 867{
869 mchip_hic_stop(); 868 mchip_hic_stop();
870 mchip_dma_free(); 869 mchip_dma_free();
871 video_exclusive_release(inode, file); 870 clear_bit(0, &meye.in_use);
872 return 0; 871 return 0;
873} 872}
874 873
@@ -1774,6 +1773,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
1774 goto outnotdev; 1773 goto outnotdev;
1775 } 1774 }
1776 1775
1776 ret = -ENOMEM;
1777 meye.mchip_dev = pcidev; 1777 meye.mchip_dev = pcidev;
1778 meye.video_dev = video_device_alloc(); 1778 meye.video_dev = video_device_alloc();
1779 if (!meye.video_dev) { 1779 if (!meye.video_dev) {
@@ -1781,7 +1781,6 @@ static int __devinit meye_probe(struct pci_dev *pcidev,
1781 goto outnotdev; 1781 goto outnotdev;
1782 } 1782 }
1783 1783
1784 ret = -ENOMEM;
1785 meye.grab_temp = vmalloc(MCHIP_NB_PAGES_MJPEG * PAGE_SIZE); 1784 meye.grab_temp = vmalloc(MCHIP_NB_PAGES_MJPEG * PAGE_SIZE);
1786 if (!meye.grab_temp) { 1785 if (!meye.grab_temp) {
1787 printk(KERN_ERR "meye: grab buffer allocation failed\n"); 1786 printk(KERN_ERR "meye: grab buffer allocation failed\n");