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/w9966.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/w9966.c')
-rw-r--r-- | drivers/media/video/w9966.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c index 2ff00bc5ad64..c635cffb1fb8 100644 --- a/drivers/media/video/w9966.c +++ b/drivers/media/video/w9966.c | |||
@@ -113,6 +113,7 @@ struct w9966_dev { | |||
113 | signed char contrast; | 113 | signed char contrast; |
114 | signed char color; | 114 | signed char color; |
115 | signed char hue; | 115 | signed char hue; |
116 | unsigned long in_use; | ||
116 | }; | 117 | }; |
117 | 118 | ||
118 | /* | 119 | /* |
@@ -184,10 +185,27 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file, | |||
184 | static ssize_t w9966_v4l_read(struct file *file, char __user *buf, | 185 | static ssize_t w9966_v4l_read(struct file *file, char __user *buf, |
185 | size_t count, loff_t *ppos); | 186 | size_t count, loff_t *ppos); |
186 | 187 | ||
188 | static int w9966_exclusive_open(struct inode *inode, struct file *file) | ||
189 | { | ||
190 | struct video_device *vdev = video_devdata(file); | ||
191 | struct w9966_dev *cam = vdev->priv; | ||
192 | |||
193 | return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; | ||
194 | } | ||
195 | |||
196 | static int w9966_exclusive_release(struct inode *inode, struct file *file) | ||
197 | { | ||
198 | struct video_device *vdev = video_devdata(file); | ||
199 | struct w9966_dev *cam = vdev->priv; | ||
200 | |||
201 | clear_bit(0, &cam->in_use); | ||
202 | return 0; | ||
203 | } | ||
204 | |||
187 | static const struct file_operations w9966_fops = { | 205 | static const struct file_operations w9966_fops = { |
188 | .owner = THIS_MODULE, | 206 | .owner = THIS_MODULE, |
189 | .open = video_exclusive_open, | 207 | .open = w9966_exclusive_open, |
190 | .release = video_exclusive_release, | 208 | .release = w9966_exclusive_release, |
191 | .ioctl = w9966_v4l_ioctl, | 209 | .ioctl = w9966_v4l_ioctl, |
192 | #ifdef CONFIG_COMPAT | 210 | #ifdef CONFIG_COMPAT |
193 | .compat_ioctl = v4l_compat_ioctl32, | 211 | .compat_ioctl = v4l_compat_ioctl32, |