Skip to content

Commit 15b5ef4

Browse files
Christoph Hellwigtiwai
authored andcommitted
ALSA: hal2: switch to dma_alloc_attrs
Use dma_alloc_attrs directly instead of the dma_alloc_noncoherent wrapper. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent ba61faf commit 15b5ef4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sound/mips/hal2.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -461,15 +461,15 @@ static int hal2_alloc_dmabuf(struct hal2_codec *codec)
461461
int count = H2_BUF_SIZE / H2_BLOCK_SIZE;
462462
int i;
463463

464-
codec->buffer = dma_alloc_noncoherent(NULL, H2_BUF_SIZE,
465-
&buffer_dma, GFP_KERNEL);
464+
codec->buffer = dma_alloc_attrs(NULL, H2_BUF_SIZE, &buffer_dma,
465+
GFP_KERNEL, DMA_ATTR_NON_CONSISTENT);
466466
if (!codec->buffer)
467467
return -ENOMEM;
468-
desc = dma_alloc_noncoherent(NULL, count * sizeof(struct hal2_desc),
469-
&desc_dma, GFP_KERNEL);
468+
desc = dma_alloc_attrs(NULL, count * sizeof(struct hal2_desc),
469+
&desc_dma, GFP_KERNEL, DMA_ATTR_NON_CONSISTENT);
470470
if (!desc) {
471-
dma_free_noncoherent(NULL, H2_BUF_SIZE,
472-
codec->buffer, buffer_dma);
471+
dma_free_attrs(NULL, H2_BUF_SIZE, codec->buffer, buffer_dma,
472+
DMA_ATTR_NON_CONSISTENT);
473473
return -ENOMEM;
474474
}
475475
codec->buffer_dma = buffer_dma;
@@ -490,10 +490,10 @@ static int hal2_alloc_dmabuf(struct hal2_codec *codec)
490490

491491
static void hal2_free_dmabuf(struct hal2_codec *codec)
492492
{
493-
dma_free_noncoherent(NULL, codec->desc_count * sizeof(struct hal2_desc),
494-
codec->desc, codec->desc_dma);
495-
dma_free_noncoherent(NULL, H2_BUF_SIZE, codec->buffer,
496-
codec->buffer_dma);
493+
dma_free_attrs(NULL, codec->desc_count * sizeof(struct hal2_desc),
494+
codec->desc, codec->desc_dma, DMA_ATTR_NON_CONSISTENT);
495+
dma_free_attrs(NULL, H2_BUF_SIZE, codec->buffer, codec->buffer_dma,
496+
DMA_ATTR_NON_CONSISTENT);
497497
}
498498

499499
static struct snd_pcm_hardware hal2_pcm_hw = {

0 commit comments

Comments
 (0)