diff options
Diffstat (limited to 'drivers/media/video/meye.c')
-rw-r--r-- | drivers/media/video/meye.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c index 102a5b9cfd12..6418f4a78f2a 100644 --- a/drivers/media/video/meye.c +++ b/drivers/media/video/meye.c | |||
@@ -843,21 +843,16 @@ again: | |||
843 | 843 | ||
844 | static int meye_open(struct inode *inode, struct file *file) | 844 | static int meye_open(struct inode *inode, struct file *file) |
845 | { | 845 | { |
846 | int i, err; | 846 | int i; |
847 | 847 | ||
848 | lock_kernel(); | 848 | if (test_and_set_bit(0, &meye.in_use)) |
849 | err = video_exclusive_open(inode, file); | 849 | return -EBUSY; |
850 | if (err < 0) { | ||
851 | unlock_kernel(); | ||
852 | return err; | ||
853 | } | ||
854 | 850 | ||
855 | mchip_hic_stop(); | 851 | mchip_hic_stop(); |
856 | 852 | ||
857 | if (mchip_dma_alloc()) { | 853 | if (mchip_dma_alloc()) { |
858 | printk(KERN_ERR "meye: mchip framebuffer allocation failed\n"); | 854 | printk(KERN_ERR "meye: mchip framebuffer allocation failed\n"); |
859 | video_exclusive_release(inode, file); | 855 | clear_bit(0, &meye.in_use); |
860 | unlock_kernel(); | ||
861 | return -ENOBUFS; | 856 | return -ENOBUFS; |
862 | } | 857 | } |
863 | 858 | ||
@@ -865,7 +860,6 @@ static int meye_open(struct inode *inode, struct file *file) | |||
865 | meye.grab_buffer[i].state = MEYE_BUF_UNUSED; | 860 | meye.grab_buffer[i].state = MEYE_BUF_UNUSED; |
866 | kfifo_reset(meye.grabq); | 861 | kfifo_reset(meye.grabq); |
867 | kfifo_reset(meye.doneq); | 862 | kfifo_reset(meye.doneq); |
868 | unlock_kernel(); | ||
869 | return 0; | 863 | return 0; |
870 | } | 864 | } |
871 | 865 | ||
@@ -873,7 +867,7 @@ static int meye_release(struct inode *inode, struct file *file) | |||
873 | { | 867 | { |
874 | mchip_hic_stop(); | 868 | mchip_hic_stop(); |
875 | mchip_dma_free(); | 869 | mchip_dma_free(); |
876 | video_exclusive_release(inode, file); | 870 | clear_bit(0, &meye.in_use); |
877 | return 0; | 871 | return 0; |
878 | } | 872 | } |
879 | 873 | ||