aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-alsa-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx18/cx18-alsa-pcm.c')
-rw-r--r--drivers/media/video/cx18/cx18-alsa-pcm.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/media/video/cx18/cx18-alsa-pcm.c b/drivers/media/video/cx18/cx18-alsa-pcm.c
index e613826d5a47..6e56df94e34b 100644
--- a/drivers/media/video/cx18/cx18-alsa-pcm.c
+++ b/drivers/media/video/cx18/cx18-alsa-pcm.c
@@ -55,7 +55,7 @@ static struct snd_pcm_hardware snd_cx18_hw_capture = {
55 55
56 .formats = SNDRV_PCM_FMTBIT_S16_LE, 56 .formats = SNDRV_PCM_FMTBIT_S16_LE,
57 57
58 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_KNOT, 58 .rates = SNDRV_PCM_RATE_48000,
59 59
60 .rate_min = 48000, 60 .rate_min = 48000,
61 .rate_max = 48000, 61 .rate_max = 48000,
@@ -196,7 +196,6 @@ static int snd_cx18_pcm_capture_open(struct snd_pcm_substream *substream)
196 196
197static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream) 197static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream)
198{ 198{
199 unsigned long flags;
200 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream); 199 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream);
201 struct v4l2_device *v4l2_dev = cxsc->v4l2_dev; 200 struct v4l2_device *v4l2_dev = cxsc->v4l2_dev;
202 struct cx18 *cx = to_cx18(v4l2_dev); 201 struct cx18 *cx = to_cx18(v4l2_dev);
@@ -212,14 +211,6 @@ static int snd_cx18_pcm_capture_close(struct snd_pcm_substream *substream)
212 211
213 cx->pcm_announce_callback = NULL; 212 cx->pcm_announce_callback = NULL;
214 213
215 spin_lock_irqsave(&cxsc->slock, flags);
216 if (substream->runtime->dma_area) {
217 dprintk("freeing pcm capture region\n");
218 vfree(substream->runtime->dma_area);
219 substream->runtime->dma_area = NULL;
220 }
221 spin_unlock_irqrestore(&cxsc->slock, flags);
222
223 return 0; 214 return 0;
224} 215}
225 216
@@ -265,6 +256,17 @@ static int snd_cx18_pcm_hw_params(struct snd_pcm_substream *substream,
265 256
266static int snd_cx18_pcm_hw_free(struct snd_pcm_substream *substream) 257static int snd_cx18_pcm_hw_free(struct snd_pcm_substream *substream)
267{ 258{
259 struct snd_cx18_card *cxsc = snd_pcm_substream_chip(substream);
260 unsigned long flags;
261
262 spin_lock_irqsave(&cxsc->slock, flags);
263 if (substream->runtime->dma_area) {
264 dprintk("freeing pcm capture region\n");
265 vfree(substream->runtime->dma_area);
266 substream->runtime->dma_area = NULL;
267 }
268 spin_unlock_irqrestore(&cxsc->slock, flags);
269
268 return 0; 270 return 0;
269} 271}
270 272