diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-09 10:49:37 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-11 07:25:22 +0100 |
commit | 1075b321ab4300e5ee73eeb97980b45bc2ce13b6 (patch) | |
tree | bfe8f13e581fed4d3279aa9175f94a0062b10916 /sound/usb/caiaq/audio.c | |
parent | a3c10ea47e6dd087e92e8ebbc7844ea48c4c17c3 (diff) | |
download | linux-1075b321ab4300e5ee73eeb97980b45bc2ce13b6.tar.bz2 |
ALSA: caiaq: Use managed buffer allocation
Clean up the driver with the new managed buffer allocation API.
The hw_params callback became superfluous and dropped.
The hw_free callback still remains because of the substream
deactivation sync call.
Link: https://lore.kernel.org/r/20191209094943.14984-66-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/caiaq/audio.c')
-rw-r--r-- | sound/usb/caiaq/audio.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 970eb0865ba3..8513b120e57e 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -167,17 +167,11 @@ static int snd_usb_caiaq_substream_close(struct snd_pcm_substream *substream) return 0; } -static int snd_usb_caiaq_pcm_hw_params(struct snd_pcm_substream *sub, - struct snd_pcm_hw_params *hw_params) -{ - return snd_pcm_lib_malloc_pages(sub, params_buffer_bytes(hw_params)); -} - static int snd_usb_caiaq_pcm_hw_free(struct snd_pcm_substream *sub) { struct snd_usb_caiaqdev *cdev = snd_pcm_substream_chip(sub); deactivate_substream(cdev, sub); - return snd_pcm_lib_free_pages(sub); + return 0; } /* this should probably go upstream */ @@ -328,7 +322,6 @@ static const struct snd_pcm_ops snd_usb_caiaq_ops = { .open = snd_usb_caiaq_substream_open, .close = snd_usb_caiaq_substream_close, .ioctl = snd_pcm_lib_ioctl, - .hw_params = snd_usb_caiaq_pcm_hw_params, .hw_free = snd_usb_caiaq_pcm_hw_free, .prepare = snd_usb_caiaq_pcm_prepare, .trigger = snd_usb_caiaq_pcm_trigger, @@ -841,8 +834,8 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev) &snd_usb_caiaq_ops); snd_pcm_set_ops(cdev->pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_usb_caiaq_ops); - snd_pcm_lib_preallocate_pages_for_all(cdev->pcm, SNDRV_DMA_TYPE_VMALLOC, - NULL, 0, 0); + snd_pcm_set_managed_buffer_all(cdev->pcm, SNDRV_DMA_TYPE_VMALLOC, + NULL, 0, 0); cdev->data_cb_info = kmalloc_array(N_URBS, sizeof(struct snd_usb_caiaq_cb_info), |