diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-12-09 12:49:15 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-12-11 09:25:13 +0300 |
commit | 28d52aa55436630327d938b165b7c37febcbd36f (patch) | |
tree | 4e5dfc4bc4f8240a44a79418f9d68d0da5ea1aa3 /sound/pci/intel8x0.c | |
parent | 09e263cd4a1d16f12e5bca8a5575ed2a2dddbf11 (diff) | |
download | linux-28d52aa55436630327d938b165b7c37febcbd36f.tar.xz |
ALSA: intel8x0: 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-44-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/intel8x0.c')
-rw-r--r-- | sound/pci/intel8x0.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 12374ba08ca2..b171816e58a8 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -901,9 +901,6 @@ static int snd_intel8x0_hw_params(struct snd_pcm_substream *substream, int dbl = params_rate(hw_params) > 48000; int err; - err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); - if (err < 0) - return err; if (ichdev->pcm_open_flag) { snd_ac97_pcm_close(ichdev->pcm); ichdev->pcm_open_flag = 0; @@ -929,7 +926,7 @@ static int snd_intel8x0_hw_free(struct snd_pcm_substream *substream) snd_ac97_pcm_close(ichdev->pcm); ichdev->pcm_open_flag = 0; } - return snd_pcm_lib_free_pages(substream); + return 0; } static void snd_intel8x0_setup_pcm_out(struct intel8x0 *chip, @@ -1487,9 +1484,9 @@ static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device, strcpy(pcm->name, chip->card->shortname); chip->pcm[device] = pcm; - snd_pcm_lib_preallocate_pages_for_all(pcm, intel8x0_dma_type(chip), - &chip->pci->dev, - rec->prealloc_size, rec->prealloc_max_size); + snd_pcm_set_managed_buffer_all(pcm, intel8x0_dma_type(chip), + &chip->pci->dev, + rec->prealloc_size, rec->prealloc_max_size); if (rec->playback_ops && rec->playback_ops->open == snd_intel8x0_playback_open) { |