Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 005f3e6

Browse files
committed
ALSA: parisc: Use managed buffer allocation
Clean up the driver with the new managed buffer allocation API. The hw_free callbacks became superfluous and got dropped. Link: https://lore.kernel.org/r/20191209094943.14984-19-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent ee88f4e commit 005f3e6

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

sound/parisc/harmony.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -567,28 +567,19 @@ static int
567567
snd_harmony_hw_params(struct snd_pcm_substream *ss,
568568
struct snd_pcm_hw_params *hw)
569569
{
570-
int err;
571570
struct snd_harmony *h = snd_pcm_substream_chip(ss);
572571

573-
err = snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw));
574-
if (err > 0 && h->dma.type == SNDRV_DMA_TYPE_CONTINUOUS)
572+
if (h->dma.type == SNDRV_DMA_TYPE_CONTINUOUS)
575573
ss->runtime->dma_addr = __pa(ss->runtime->dma_area);
576-
577-
return err;
578-
}
579574

580-
static int
581-
snd_harmony_hw_free(struct snd_pcm_substream *ss)
582-
{
583-
return snd_pcm_lib_free_pages(ss);
575+
return 0;
584576
}
585577

586578
static const struct snd_pcm_ops snd_harmony_playback_ops = {
587579
.open = snd_harmony_playback_open,
588580
.close = snd_harmony_playback_close,
589581
.ioctl = snd_pcm_lib_ioctl,
590582
.hw_params = snd_harmony_hw_params,
591-
.hw_free = snd_harmony_hw_free,
592583
.prepare = snd_harmony_playback_prepare,
593584
.trigger = snd_harmony_playback_trigger,
594585
.pointer = snd_harmony_playback_pointer,
@@ -599,7 +590,6 @@ static const struct snd_pcm_ops snd_harmony_capture_ops = {
599590
.close = snd_harmony_capture_close,
600591
.ioctl = snd_pcm_lib_ioctl,
601592
.hw_params = snd_harmony_hw_params,
602-
.hw_free = snd_harmony_hw_free,
603593
.prepare = snd_harmony_capture_prepare,
604594
.trigger = snd_harmony_capture_trigger,
605595
.pointer = snd_harmony_capture_pointer,
@@ -656,8 +646,8 @@ snd_harmony_pcm_init(struct snd_harmony *h)
656646
}
657647

658648
/* pre-allocate space for DMA */
659-
snd_pcm_lib_preallocate_pages_for_all(pcm, h->dma.type, h->dma.dev,
660-
MAX_BUF_SIZE, MAX_BUF_SIZE);
649+
snd_pcm_set_managed_buffer_all(pcm, h->dma.type, h->dma.dev,
650+
MAX_BUF_SIZE, MAX_BUF_SIZE);
661651

662652
h->st.format = snd_harmony_set_data_format(h,
663653
SNDRV_PCM_FORMAT_S16_BE, 1);

0 commit comments

Comments
 (0)