|
@@ -311,23 +311,23 @@ static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd)
|
|
* should allocate a DMA buffer only for the streams that are valid.
|
|
* should allocate a DMA buffer only for the streams that are valid.
|
|
*/
|
|
*/
|
|
|
|
|
|
- if (pcm->streams[0].substream) {
|
|
|
|
|
|
+ if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
|
|
ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
|
|
ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
|
|
fsl_dma_hardware.buffer_bytes_max,
|
|
fsl_dma_hardware.buffer_bytes_max,
|
|
- &pcm->streams[0].substream->dma_buffer);
|
|
|
|
|
|
+ &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer);
|
|
if (ret) {
|
|
if (ret) {
|
|
dev_err(card->dev, "can't alloc playback dma buffer\n");
|
|
dev_err(card->dev, "can't alloc playback dma buffer\n");
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (pcm->streams[1].substream) {
|
|
|
|
|
|
+ if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
|
|
ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
|
|
ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev,
|
|
fsl_dma_hardware.buffer_bytes_max,
|
|
fsl_dma_hardware.buffer_bytes_max,
|
|
- &pcm->streams[1].substream->dma_buffer);
|
|
|
|
|
|
+ &pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->dma_buffer);
|
|
if (ret) {
|
|
if (ret) {
|
|
dev_err(card->dev, "can't alloc capture dma buffer\n");
|
|
dev_err(card->dev, "can't alloc capture dma buffer\n");
|
|
- snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer);
|
|
|
|
|
|
+ snd_dma_free_pages(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
}
|
|
}
|