diff options
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 52c6657d61cf..8e9957dbdbec 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
@@ -381,19 +381,27 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream, | |||
381 | int cmd) | 381 | int cmd) |
382 | { | 382 | { |
383 | struct em28xx *dev = snd_pcm_substream_chip(substream); | 383 | struct em28xx *dev = snd_pcm_substream_chip(substream); |
384 | int retval; | ||
384 | 385 | ||
385 | dprintk("Should %s capture\n", (cmd == SNDRV_PCM_TRIGGER_START)? | 386 | dprintk("Should %s capture\n", (cmd == SNDRV_PCM_TRIGGER_START)? |
386 | "start": "stop"); | 387 | "start": "stop"); |
388 | |||
389 | spin_lock(&dev->adev.slock); | ||
387 | switch (cmd) { | 390 | switch (cmd) { |
388 | case SNDRV_PCM_TRIGGER_START: | 391 | case SNDRV_PCM_TRIGGER_START: |
389 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1); | 392 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1); |
390 | return 0; | 393 | retval = 0; |
394 | break; | ||
391 | case SNDRV_PCM_TRIGGER_STOP: | 395 | case SNDRV_PCM_TRIGGER_STOP: |
392 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0); | 396 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0); |
393 | return 0; | 397 | retval = 0; |
398 | break; | ||
394 | default: | 399 | default: |
395 | return -EINVAL; | 400 | retval = -EINVAL; |
396 | } | 401 | } |
402 | |||
403 | spin_unlock(&dev->adev.slock); | ||
404 | return retval; | ||
397 | } | 405 | } |
398 | 406 | ||
399 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream | 407 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream |