summaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireface
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-12-09 10:48:41 +0100
committerTakashi Iwai <tiwai@suse.de>2019-12-11 07:24:59 +0100
commit7641d549b13bbb1dcc6c7759c010c1ca288c90be (patch)
treea8bd4d2cdff2516a27f0efdcbb4a171bc3a3434f /sound/firewire/fireface
parent8f326303b0d89a6f7efaa56e4c02d6584c6d61df (diff)
downloadlinux-7641d549b13bbb1dcc6c7759c010c1ca288c90be.tar.gz
linux-7641d549b13bbb1dcc6c7759c010c1ca288c90be.tar.bz2
linux-7641d549b13bbb1dcc6c7759c010c1ca288c90be.zip
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 <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20191209192422.23902-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface')
-rw-r--r--sound/firewire/fireface/ff-pcm.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sound/firewire/fireface/ff-pcm.c b/sound/firewire/fireface/ff-pcm.c
index bd91c6ecb112..a52a4344ec6f 100644
--- a/sound/firewire/fireface/ff-pcm.c
+++ b/sound/firewire/fireface/ff-pcm.c
@@ -228,11 +228,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
struct snd_ff *ff = 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);
@@ -263,7 +259,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
mutex_unlock(&ff->mutex);
- return snd_pcm_lib_free_pages(substream);
+ return 0;
}
static int pcm_capture_prepare(struct snd_pcm_substream *substream)
@@ -400,8 +396,7 @@ int snd_ff_create_pcm_devices(struct snd_ff *ff)
"%s PCM", ff->card->shortname);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_capture_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;
}