diff options
author | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-02-07 23:11:13 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:44 -0400 |
commit | bf510ac380c0e5aac813455fdf7364613cf75b72 (patch) | |
tree | 6d72328d2d26cff463258e849eebabd7534cecba /drivers | |
parent | df39ca6437410b9428ebd3ce30fcde193782410d (diff) |
V4L/DVB (10521): em28xx-audio: Add lock for users
Added lock for users count
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 8e9957dbdbec..38436af2164b 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
@@ -313,7 +313,9 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) | |||
313 | dprintk("changing alternate number to 7\n"); | 313 | dprintk("changing alternate number to 7\n"); |
314 | } | 314 | } |
315 | 315 | ||
316 | mutex_lock(&dev->lock); | ||
316 | dev->adev.users++; | 317 | dev->adev.users++; |
318 | mutex_unlock(&dev->lock); | ||
317 | 319 | ||
318 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); | 320 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); |
319 | dev->adev.capture_pcm_substream = substream; | 321 | dev->adev.capture_pcm_substream = substream; |
@@ -328,12 +330,12 @@ err: | |||
328 | static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) | 330 | static int snd_em28xx_pcm_close(struct snd_pcm_substream *substream) |
329 | { | 331 | { |
330 | struct em28xx *dev = snd_pcm_substream_chip(substream); | 332 | struct em28xx *dev = snd_pcm_substream_chip(substream); |
331 | dev->adev.users--; | ||
332 | 333 | ||
333 | dprintk("closing device\n"); | 334 | dprintk("closing device\n"); |
334 | 335 | ||
335 | dev->mute = 1; | 336 | dev->mute = 1; |
336 | mutex_lock(&dev->lock); | 337 | mutex_lock(&dev->lock); |
338 | dev->adev.users--; | ||
337 | em28xx_audio_analog_set(dev); | 339 | em28xx_audio_analog_set(dev); |
338 | mutex_unlock(&dev->lock); | 340 | mutex_unlock(&dev->lock); |
339 | 341 | ||