diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-09 10:49:27 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-11 07:25:18 +0100 |
commit | 8e2c75249d066ff365d8dc5028ce3c402c3a7230 (patch) | |
tree | ee8ff1ef39a0f09a0f95c57f84e2016440be2cbb /sound/pci/via82xx_modem.c | |
parent | c79eafa095b192e251ece9e8016c8012e47fe303 (diff) |
ALSA: via82xx: Use managed buffer allocation
Clean up the drivers with the new managed buffer allocation API.
The superfluous snd_pcm_lib_malloc_pages() and
snd_pcm_lib_free_pages() calls are dropped.
Link: https://lore.kernel.org/r/20191209094943.14984-56-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/via82xx_modem.c')
-rw-r--r-- | sound/pci/via82xx_modem.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 0edb9ea6e8a6..22eaa9216598 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -642,9 +642,6 @@ static int snd_via82xx_hw_params(struct snd_pcm_substream *substream, struct viadev *viadev = substream->runtime->private_data; int err; - err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); - if (err < 0) - return err; err = build_via_table(viadev, substream, chip->pci, params_periods(hw_params), params_period_bytes(hw_params)); @@ -667,7 +664,6 @@ static int snd_via82xx_hw_free(struct snd_pcm_substream *substream) struct viadev *viadev = substream->runtime->private_data; clean_via_table(viadev, substream, chip->pci); - snd_pcm_lib_free_pages(substream); return 0; } @@ -849,9 +845,8 @@ static int snd_via686_pcm_new(struct via82xx_modem *chip) init_viadev(chip, 0, VIA_REG_MO_STATUS, 0); init_viadev(chip, 1, VIA_REG_MI_STATUS, 1); - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, - &chip->pci->dev, - 64*1024, 128*1024); + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_SG, + &chip->pci->dev, 64*1024, 128*1024); return 0; } |