diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-09 10:48:49 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-11 07:25:02 +0100 |
commit | ee88f4ebe57523889fc437bc42f95d9ab89bdd9f (patch) | |
tree | 0ed7a157aae55376ea2399ce0679cb7803edd5fa /sound/mips/sgio2audio.c | |
parent | ALSA: wss: Use managed buffer allocation (diff) | |
download | linux-ee88f4ebe57523889fc437bc42f95d9ab89bdd9f.tar.xz linux-ee88f4ebe57523889fc437bc42f95d9ab89bdd9f.zip |
ALSA: mips: Use managed buffer allocation
Clean up the drivers 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-18-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/mips/sgio2audio.c')
-rw-r--r-- | sound/mips/sgio2audio.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index 9d20ce6118a0..481f5ffff61b 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -577,20 +577,6 @@ static int snd_sgio2audio_pcm_close(struct snd_pcm_substream *substream) return 0; } - -/* hw_params callback */ -static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *hw_params) -{ - return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); -} - -/* hw_free callback */ -static int snd_sgio2audio_pcm_hw_free(struct snd_pcm_substream *substream) -{ - return snd_pcm_lib_free_pages(substream); -} - /* prepare callback */ static int snd_sgio2audio_pcm_prepare(struct snd_pcm_substream *substream) { @@ -716,8 +702,7 @@ static int snd_sgio2audio_new_pcm(struct snd_sgio2audio *chip) &snd_sgio2audio_playback1_ops); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sgio2audio_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); /* create second pcm device with one outputs and no input */ err = snd_pcm_new(chip->card, "SGI O2 Audio", 1, 1, 0, &pcm); @@ -730,8 +715,7 @@ static int snd_sgio2audio_new_pcm(struct snd_sgio2audio *chip) /* set operators */ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sgio2audio_playback2_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; } |