diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-09 10:48:40 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-11 07:24:58 +0100 |
commit | 8f326303b0d89a6f7efaa56e4c02d6584c6d61df (patch) | |
tree | 6fbaa821f07f2c29b1085a16db22280650750ff6 | |
parent | d635f09e919e6ea9214a7676e26ef6755b3453a0 (diff) | |
download | linux-8f326303b0d89a6f7efaa56e4c02d6584c6d61df.tar.bz2 |
ALSA: vx: Use managed buffer allocation
Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and got
dropped.
Link: https://lore.kernel.org/r/20191209094943.14984-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/drivers/vx/vx_pcm.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c index f17e0a76c73c..615e8b2b85f6 100644 --- a/sound/drivers/vx/vx_pcm.c +++ b/sound/drivers/vx/vx_pcm.c @@ -773,23 +773,6 @@ static snd_pcm_uframes_t vx_pcm_playback_pointer(struct snd_pcm_substream *subs) } /* - * vx_pcm_hw_params - hw_params callback for playback and capture - */ -static int vx_pcm_hw_params(struct snd_pcm_substream *subs, - struct snd_pcm_hw_params *hw_params) -{ - return snd_pcm_lib_malloc_pages(subs, params_buffer_bytes(hw_params)); -} - -/* - * vx_pcm_hw_free - hw_free callback for playback and capture - */ -static int vx_pcm_hw_free(struct snd_pcm_substream *subs) -{ - return snd_pcm_lib_free_pages(subs); -} - -/* * vx_pcm_prepare - prepare callback for playback and capture */ static int vx_pcm_prepare(struct snd_pcm_substream *subs) @@ -861,8 +844,6 @@ static const struct snd_pcm_ops vx_pcm_playback_ops = { .open = vx_pcm_playback_open, .close = vx_pcm_playback_close, .ioctl = snd_pcm_lib_ioctl, - .hw_params = vx_pcm_hw_params, - .hw_free = vx_pcm_hw_free, .prepare = vx_pcm_prepare, .trigger = vx_pcm_trigger, .pointer = vx_pcm_playback_pointer, @@ -1081,8 +1062,6 @@ static const struct snd_pcm_ops vx_pcm_capture_ops = { .open = vx_pcm_capture_open, .close = vx_pcm_capture_close, .ioctl = snd_pcm_lib_ioctl, - .hw_params = vx_pcm_hw_params, - .hw_free = vx_pcm_hw_free, .prepare = vx_pcm_prepare, .trigger = vx_pcm_trigger, .pointer = vx_pcm_capture_pointer, @@ -1230,9 +1209,9 @@ int snd_vx_pcm_new(struct vx_core *chip) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &vx_pcm_playback_ops); if (ins) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &vx_pcm_capture_ops); - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC, - snd_dma_continuous_data(GFP_KERNEL | GFP_DMA32), - 0, 0); + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, + snd_dma_continuous_data(GFP_KERNEL | GFP_DMA32), + 0, 0); pcm->private_data = chip; pcm->private_free = snd_vx_pcm_free; |