diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-08-23 04:31:47 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:53 -0400 |
commit | 7d43cd53c851e3cf04d73108d4e7e25a1104c6f5 (patch) | |
tree | 4fcf2e3148065f1727b630deefef9612610bf789 /drivers/media/video/meye.c | |
parent | 2f3d00250ae5b1d2727e2723da805290ec408503 (diff) |
V4L/DVB (8780): v4l: replace the last uses of video_exclusive_open/release
Handle the video_exclusive_open/release functionality inside the
driver.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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 | ||