diff options
author | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-02-08 02:11:13 -0200 |
---|---|---|
committer | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-02-08 02:11:13 -0200 |
commit | 88f9e29eb77d77129e59b899af1ef9e462997409 (patch) | |
tree | 8a563a49c2863c3593c0bc87c8610e649b703728 /linux | |
parent | c06f528a6de5324f104965c8a90907211963e29e (diff) | |
download | mediapointer-dvb-s2-88f9e29eb77d77129e59b899af1ef9e462997409.tar.gz mediapointer-dvb-s2-88f9e29eb77d77129e59b899af1ef9e462997409.tar.bz2 |
em28xx-audio: Add lock for users
From: Douglas Schilling Landgraf <dougsland@redhat.com>
Added lock for users count
Priority: high
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-audio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-audio.c b/linux/drivers/media/video/em28xx/em28xx-audio.c index a5a28eb19..5102ff75f 100644 --- a/linux/drivers/media/video/em28xx/em28xx-audio.c +++ b/linux/drivers/media/video/em28xx/em28xx-audio.c @@ -356,7 +356,9 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) dprintk("changing alternate number to 7\n"); } + mutex_lock(&dev->lock); dev->adev.users++; + mutex_unlock(&dev->lock); snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); dev->adev.capture_pcm_substream = substream; @@ -375,12 +377,12 @@ static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) #endif { struct em28xx *dev = snd_pcm_substream_chip(substream); - dev->adev.users--; dprintk("closing device\n"); dev->mute = 1; mutex_lock(&dev->lock); + dev->adev.users--; em28xx_audio_analog_set(dev); mutex_unlock(&dev->lock); |