From 7641d549b13bbb1dcc6c7759c010c1ca288c90be Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 9 Dec 2019 10:48:41 +0100 Subject: ALSA: firewire: Use managed buffer allocation Clean up the drivers with the new managed buffer allocation API. The superfluous snd_pcm_lib_malloc_pages() and snd_pcm_lib_free_pages() calls are dropped. Acked-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20191209192422.23902-1-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/firewire/dice/dice-pcm.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'sound/firewire/dice') diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c index be79d659eedf..2700f7f6f754 100644 --- a/sound/firewire/dice/dice-pcm.c +++ b/sound/firewire/dice/dice-pcm.c @@ -264,11 +264,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params) { struct snd_dice *dice = substream->private_data; - int err; - - err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); - if (err < 0) - return err; + int err = 0; if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN) { unsigned int rate = params_rate(hw_params); @@ -304,7 +300,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) mutex_unlock(&dice->mutex); - return snd_pcm_lib_free_pages(substream); + return 0; } static int capture_prepare(struct snd_pcm_substream *substream) @@ -457,9 +453,8 @@ int snd_dice_create_pcm(struct snd_dice *dice) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &playback_ops); - snd_pcm_lib_preallocate_pages_for_all(pcm, - SNDRV_DMA_TYPE_VMALLOC, - NULL, 0, 0); + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, + NULL, 0, 0); } return 0; -- cgit v1.2.3