ALSA: atiixp: 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-25-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -783,9 +783,6 @@ static int snd_atiixp_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||
int err;
|
||||
int i;
|
||||
|
||||
err = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
|
||||
if (err < 0)
|
||||
return err;
|
||||
dma->buf_addr = substream->runtime->dma_addr;
|
||||
dma->buf_bytes = params_buffer_bytes(hw_params);
|
||||
|
||||
@@ -812,7 +809,6 @@ static int snd_atiixp_pcm_hw_free(struct snd_pcm_substream *substream)
|
||||
struct atiixp_dma *dma = substream->runtime->private_data;
|
||||
|
||||
atiixp_clear_dma_packets(chip, dma, substream);
|
||||
snd_pcm_lib_free_pages(substream);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -994,9 +990,8 @@ static int snd_atiixp_pcm_new(struct atiixp_modem *chip)
|
||||
strcpy(pcm->name, "ATI IXP MC97");
|
||||
chip->pcmdevs[ATI_PCMDEV_ANALOG] = pcm;
|
||||
|
||||
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
|
||||
&chip->pci->dev,
|
||||
64*1024, 128*1024);
|
||||
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
|
||||
&chip->pci->dev, 64*1024, 128*1024);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user