diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-06 22:52:15 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-18 15:15:16 +0100 |
commit | 92ea42f442c4895e38f525a097d7d8ce2a55b9b9 (patch) | |
tree | ff9fb45b36ace09f373e9e7f3d27ddf7e1006594 /drivers/media/video/em28xx/em28xx-audio.c | |
parent | V4L/DVB (7163): em28xx: makes audio settings more stable (diff) | |
download | linux-92ea42f442c4895e38f525a097d7d8ce2a55b9b9.tar.xz linux-92ea42f442c4895e38f525a097d7d8ce2a55b9b9.zip |
V4L/DVB (7164): em28xx-alsa: Add a missing mutex
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 2c7343d3139d..8c67f678266a 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c @@ -269,8 +269,11 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) dprintk("opening device and trying to acquire exclusive lock\n"); /* Sets volume, mute, etc */ + dev->mute = 0; + mutex_lock(&dev->lock); ret = em28xx_audio_analog_set(dev); + mutex_unlock(&dev->lock); if (ret < 0) goto err; @@ -302,7 +305,9 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) dprintk("closing device\n"); dev->mute = 1; + mutex_lock(&dev->lock); em28xx_audio_analog_set(dev); + mutex_unlock(&dev->lock); if (dev->adev->users == 0 && dev->adev->shutdown == 1) { dprintk("audio users: %d\n", dev->adev->users); |