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/bw-qcam.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/bw-qcam.c')
-rw-r--r-- | drivers/media/video/bw-qcam.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index 01f07707827f..e8e1bb122b59 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c | |||
@@ -894,10 +894,27 @@ static ssize_t qcam_read(struct file *file, char __user *buf, | |||
894 | return len; | 894 | return len; |
895 | } | 895 | } |
896 | 896 | ||
897 | static int qcam_exclusive_open(struct inode *inode, struct file *file) | ||
898 | { | ||
899 | struct video_device *dev = video_devdata(file); | ||
900 | struct qcam_device *qcam = (struct qcam_device *)dev; | ||
901 | |||
902 | return test_and_set_bit(0, &qcam->in_use) ? -EBUSY : 0; | ||
903 | } | ||
904 | |||
905 | static int qcam_exclusive_release(struct inode *inode, struct file *file) | ||
906 | { | ||
907 | struct video_device *dev = video_devdata(file); | ||
908 | struct qcam_device *qcam = (struct qcam_device *)dev; | ||
909 | |||
910 | clear_bit(0, &qcam->in_use); | ||
911 | return 0; | ||
912 | } | ||
913 | |||
897 | static const struct file_operations qcam_fops = { | 914 | static const struct file_operations qcam_fops = { |
898 | .owner = THIS_MODULE, | 915 | .owner = THIS_MODULE, |
899 | .open = video_exclusive_open, | 916 | .open = qcam_exclusive_open, |
900 | .release = video_exclusive_release, | 917 | .release = qcam_exclusive_release, |
901 | .ioctl = qcam_ioctl, | 918 | .ioctl = qcam_ioctl, |
902 | #ifdef CONFIG_COMPAT | 919 | #ifdef CONFIG_COMPAT |
903 | .compat_ioctl = v4l_compat_ioctl32, | 920 | .compat_ioctl = v4l_compat_ioctl32, |