diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-08-23 03:49:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:53 -0400 |
commit | 3ca685aae04960eaa8b2c97baf384996c20cf9ac (patch) | |
tree | a4d99449643380c62b11a05d93f81b6b8a2f82d7 /drivers/media/radio/radio-aimslab.c | |
parent | 3b5df8ea40ac533c62b8e5f9f173d985665fc752 (diff) |
V4L/DVB (8776): radio: replace video_exclusive_open/release
Move the video_exclusive_open/release functionality into the driver itself.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-aimslab.c')
-rw-r--r-- | drivers/media/radio/radio-aimslab.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index 1f064f4b32df..b657c7bb47cc 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c | |||
@@ -51,6 +51,7 @@ static struct mutex lock; | |||
51 | 51 | ||
52 | struct rt_device | 52 | struct rt_device |
53 | { | 53 | { |
54 | unsigned long in_use; | ||
54 | int port; | 55 | int port; |
55 | int curvol; | 56 | int curvol; |
56 | unsigned long curfreq; | 57 | unsigned long curfreq; |
@@ -378,10 +379,21 @@ static int vidioc_s_audio(struct file *file, void *priv, | |||
378 | 379 | ||
379 | static struct rt_device rtrack_unit; | 380 | static struct rt_device rtrack_unit; |
380 | 381 | ||
382 | static int rtrack_exclusive_open(struct inode *inode, struct file *file) | ||
383 | { | ||
384 | return test_and_set_bit(0, &rtrack_unit.in_use) ? -EBUSY : 0; | ||
385 | } | ||
386 | |||
387 | static int rtrack_exclusive_release(struct inode *inode, struct file *file) | ||
388 | { | ||
389 | clear_bit(0, &rtrack_unit.in_use); | ||
390 | return 0; | ||
391 | } | ||
392 | |||
381 | static const struct file_operations rtrack_fops = { | 393 | static const struct file_operations rtrack_fops = { |
382 | .owner = THIS_MODULE, | 394 | .owner = THIS_MODULE, |
383 | .open = video_exclusive_open, | 395 | .open = rtrack_exclusive_open, |
384 | .release = video_exclusive_release, | 396 | .release = rtrack_exclusive_release, |
385 | .ioctl = video_ioctl2, | 397 | .ioctl = video_ioctl2, |
386 | #ifdef CONFIG_COMPAT | 398 | #ifdef CONFIG_COMPAT |
387 | .compat_ioctl = v4l_compat_ioctl32, | 399 | .compat_ioctl = v4l_compat_ioctl32, |