diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-09 10:48:36 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-11 07:24:56 +0100 |
commit | 39729889b1f58ae42036383fc51abd067eeb4af9 (patch) | |
tree | 36740793009a8b30515f3787ab6ac23db3d7b444 /sound/drivers | |
parent | 37b9b9a5078aa2efe2131d7b0084ebd4192fb1f5 (diff) | |
download | linux-39729889b1f58ae42036383fc51abd067eeb4af9.tar.bz2 |
ALSA: aloop: Use managed buffer allocation
Clean up the driver with the new managed buffer allocation API.
The hw_params callback became superfluous and got dropped.
Link: https://lore.kernel.org/r/20191209094943.14984-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/drivers')
-rw-r--r-- | sound/drivers/aloop.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 6bb46423f5ae..104fb738cf48 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -905,12 +905,6 @@ static void loopback_runtime_free(struct snd_pcm_runtime *runtime) kfree(dpcm); } -static int loopback_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); -} - static int loopback_hw_free(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -920,7 +914,7 @@ static int loopback_hw_free(struct snd_pcm_substream *substream) mutex_lock(&dpcm->loopback->cable_lock); cable->valid &= ~(1 << substream->stream); mutex_unlock(&dpcm->loopback->cable_lock); - return snd_pcm_lib_free_pages(substream); + return 0; } static unsigned int get_cable_index(struct snd_pcm_substream *substream) @@ -1306,7 +1300,6 @@ static const struct snd_pcm_ops loopback_pcm_ops = { .open = loopback_open, .close = loopback_close, .ioctl = snd_pcm_lib_ioctl, - .hw_params = loopback_hw_params, .hw_free = loopback_hw_free, .prepare = loopback_prepare, .trigger = loopback_trigger, @@ -1325,8 +1318,7 @@ static int loopback_pcm_new(struct loopback *loopback, return err; snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &loopback_pcm_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &loopback_pcm_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); pcm->private_data = loopback; pcm->info_flags = 0; |