summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/meye.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/meye.c')
-rw-r--r--linux/drivers/media/video/meye.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/linux/drivers/media/video/meye.c b/linux/drivers/media/video/meye.c
index 331cb6d1f..535443887 100644
--- a/linux/drivers/media/video/meye.c
+++ b/linux/drivers/media/video/meye.c
@@ -848,21 +848,16 @@ again:
static int meye_open(struct inode *inode, 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;
}
@@ -870,7 +865,6 @@ 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;
}
@@ -878,7 +872,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;
}