Commit 63832bd9 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: emu10k1x: Use managed buffer allocation

Clean up the driver 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-36-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 11f63ca3
...@@ -411,8 +411,7 @@ static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream, ...@@ -411,8 +411,7 @@ static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream,
epcm->voice->epcm = epcm; epcm->voice->epcm = epcm;
} }
return snd_pcm_lib_malloc_pages(substream, return 0;
params_buffer_bytes(hw_params));
} }
/* hw_free callback */ /* hw_free callback */
...@@ -432,7 +431,7 @@ static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream) ...@@ -432,7 +431,7 @@ static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream)
epcm->voice = NULL; epcm->voice = NULL;
} }
return snd_pcm_lib_free_pages(substream); return 0;
} }
/* prepare callback */ /* prepare callback */
...@@ -594,8 +593,7 @@ static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substrea ...@@ -594,8 +593,7 @@ static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substrea
epcm->voice->use = 1; epcm->voice->use = 1;
} }
return snd_pcm_lib_malloc_pages(substream, return 0;
params_buffer_bytes(hw_params));
} }
/* hw_free callback */ /* hw_free callback */
...@@ -615,7 +613,7 @@ static int snd_emu10k1x_pcm_hw_free_capture(struct snd_pcm_substream *substream) ...@@ -615,7 +613,7 @@ static int snd_emu10k1x_pcm_hw_free_capture(struct snd_pcm_substream *substream)
epcm->voice = NULL; epcm->voice = NULL;
} }
return snd_pcm_lib_free_pages(substream); return 0;
} }
/* prepare capture callback */ /* prepare capture callback */
...@@ -876,9 +874,8 @@ static int snd_emu10k1x_pcm(struct emu10k1x *emu, int device) ...@@ -876,9 +874,8 @@ static int snd_emu10k1x_pcm(struct emu10k1x *emu, int device)
} }
emu->pcm = pcm; emu->pcm = pcm;
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
&emu->pci->dev, &emu->pci->dev, 32*1024, 32*1024);
32*1024, 32*1024);
return snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, 2, return snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, 2,
1 << 2, NULL); 1 << 2, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment