From 3acca8e979dee60c71b5930eb39211af1c1261cf Mon Sep 17 00:00:00 2001 From: Ondrej Zary Date: Sat, 11 Jun 2011 10:28:59 -0300 Subject: [PATCH] --- yaml --- r: 261331 b: refs/heads/master c: 6a529c1a4a87e0f5d143ad3bc0d37179332f210e h: refs/heads/master i: 261329: aa06076a378dab2ab233658b3f82778b2141dd42 261327: 7568b0d178c2af0efd0e2c0f372015b9313d577b v: v3 --- [refs] | 2 +- trunk/include/sound/tea575x-tuner.h | 2 +- trunk/sound/i2c/other/tea575x-tuner.c | 22 +++------------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 062e55a6c2b2..92462263c4f5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9cd49719fda38613e9d7c712b11a54ea4ea005dc +refs/heads/master: 6a529c1a4a87e0f5d143ad3bc0d37179332f210e diff --git a/trunk/include/sound/tea575x-tuner.h b/trunk/include/sound/tea575x-tuner.h index 5aa8186e7820..726e94742a5c 100644 --- a/trunk/include/sound/tea575x-tuner.h +++ b/trunk/include/sound/tea575x-tuner.h @@ -49,7 +49,7 @@ struct snd_tea575x { bool tuned; /* tuned to a station */ unsigned int val; /* hw value */ unsigned long freq; /* frequency */ - unsigned long in_use; /* set if the device is in use */ + struct mutex mutex; struct snd_tea575x_ops *ops; void *private_data; u8 card[32]; diff --git a/trunk/sound/i2c/other/tea575x-tuner.c b/trunk/sound/i2c/other/tea575x-tuner.c index 0d7a659c494c..beb0e86537cd 100644 --- a/trunk/sound/i2c/other/tea575x-tuner.c +++ b/trunk/sound/i2c/other/tea575x-tuner.c @@ -282,26 +282,9 @@ static int vidioc_s_input(struct file *filp, void *priv, unsigned int i) return 0; } -static int snd_tea575x_exclusive_open(struct file *file) -{ - struct snd_tea575x *tea = video_drvdata(file); - - return test_and_set_bit(0, &tea->in_use) ? -EBUSY : 0; -} - -static int snd_tea575x_exclusive_release(struct file *file) -{ - struct snd_tea575x *tea = video_drvdata(file); - - clear_bit(0, &tea->in_use); - return 0; -} - static const struct v4l2_file_operations tea575x_fops = { .owner = THIS_MODULE, - .open = snd_tea575x_exclusive_open, - .release = snd_tea575x_exclusive_release, - .ioctl = video_ioctl2, + .unlocked_ioctl = video_ioctl2, }; static const struct v4l2_ioctl_ops tea575x_ioctl_ops = { @@ -340,13 +323,14 @@ int snd_tea575x_init(struct snd_tea575x *tea) if (snd_tea575x_read(tea) != 0x55AA) return -ENODEV; - tea->in_use = 0; tea->val = TEA575X_BIT_BAND_FM | TEA575X_BIT_SEARCH_10_40; tea->freq = 90500 * 16; /* 90.5Mhz default */ snd_tea575x_set_freq(tea); tea->vd = tea575x_radio; video_set_drvdata(&tea->vd, tea); + mutex_init(&tea->mutex); + tea->vd.lock = &tea->mutex; v4l2_ctrl_handler_init(&tea->ctrl_handler, 1); tea->vd.ctrl_handler = &tea->ctrl_handler;