aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-aimslab.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/radio/radio-aimslab.c')
-rw-r--r--drivers/media/radio/radio-aimslab.c16
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
52struct rt_device 52struct 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
379static struct rt_device rtrack_unit; 380static struct rt_device rtrack_unit;
380 381
382static 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
387static int rtrack_exclusive_release(struct inode *inode, struct file *file)
388{
389 clear_bit(0, &rtrack_unit.in_use);
390 return 0;
391}
392
381static const struct file_operations rtrack_fops = { 393static 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,