Skip to content

Commit

Permalink
V4L/DVB (7164): em28xx-alsa: Add a missing mutex
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mauro Carvalho Chehab committed Feb 18, 2008
1 parent 00b8730 commit 92ea42f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions drivers/media/video/em28xx/em28xx-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion drivers/media/video/em28xx/em28xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ int em28xx_read_reg(struct em28xx *dev, u16 reg);
int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf,
int len);
int em28xx_write_regs(struct em28xx *dev, u16 reg, char *buf, int len);
int em28xx_set_audio_source(struct em28xx *dev);
int em28xx_audio_analog_set(struct em28xx *dev);

int em28xx_colorlevels_set_default(struct em28xx *dev);
Expand Down

0 comments on commit 92ea42f

Please sign in to comment.