diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-09 12:49:36 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-11 09:25:21 +0300 |
commit | a3c10ea47e6dd087e92e8ebbc7844ea48c4c17c3 (patch) | |
tree | 60bf435c75724615020c4d4734956c2b18d21a39 /sound/usb/6fire/pcm.c | |
parent | ce747f864268981e5db12c638265a0ddfd9c7f78 (diff) | |
download | linux-a3c10ea47e6dd087e92e8ebbc7844ea48c4c17c3.tar.xz |
ALSA: 6fire: 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-65-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/6fire/pcm.c')
-rw-r--r-- | sound/usb/6fire/pcm.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index cdc5dd7fbe16..706aa3fac351 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c @@ -446,18 +446,6 @@ static int usb6fire_pcm_close(struct snd_pcm_substream *alsa_sub) return 0; } -static int usb6fire_pcm_hw_params(struct snd_pcm_substream *alsa_sub, - struct snd_pcm_hw_params *hw_params) -{ - return snd_pcm_lib_malloc_pages(alsa_sub, - params_buffer_bytes(hw_params)); -} - -static int usb6fire_pcm_hw_free(struct snd_pcm_substream *alsa_sub) -{ - return snd_pcm_lib_free_pages(alsa_sub); -} - static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub) { struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub); @@ -555,8 +543,6 @@ static const struct snd_pcm_ops pcm_ops = { .open = usb6fire_pcm_open, .close = usb6fire_pcm_close, .ioctl = snd_pcm_lib_ioctl, - .hw_params = usb6fire_pcm_hw_params, - .hw_free = usb6fire_pcm_hw_free, .prepare = usb6fire_pcm_prepare, .trigger = usb6fire_pcm_trigger, .pointer = usb6fire_pcm_pointer, @@ -658,8 +644,7 @@ int usb6fire_pcm_init(struct sfire_chip *chip) strcpy(pcm->name, "DMX 6Fire USB"); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &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); rt->instance = pcm; |