Skip to content

Commit

Permalink
ALSA: oxygen: Remove unnecessary snd_pcm_lib_preallocate_free_for_all()
Browse files Browse the repository at this point in the history
The ALSA core takes care that all preallocated memory is freed when the PCM
itself is freed. There is no need to do this manually in the driver.

Signed-off-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
larsclausen authored and tiwai committed Jan 2, 2015
1 parent 38c4718 commit ef394ac
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions sound/pci/oxygen/oxygen_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,6 @@ static struct snd_pcm_ops oxygen_ac97_ops = {
.pointer = oxygen_pointer,
};

static void oxygen_pcm_free(struct snd_pcm *pcm)
{
snd_pcm_lib_preallocate_free_for_all(pcm);
}

int oxygen_pcm_init(struct oxygen *chip)
{
struct snd_pcm *pcm;
Expand All @@ -705,7 +700,6 @@ int oxygen_pcm_init(struct oxygen *chip)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&oxygen_rec_b_ops);
pcm->private_data = chip;
pcm->private_free = oxygen_pcm_free;
strcpy(pcm->name, "Multichannel");
if (outs)
snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream,
Expand Down Expand Up @@ -734,7 +728,6 @@ int oxygen_pcm_init(struct oxygen *chip)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&oxygen_rec_c_ops);
pcm->private_data = chip;
pcm->private_free = oxygen_pcm_free;
strcpy(pcm->name, "Digital");
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(chip->pci),
Expand Down Expand Up @@ -765,7 +758,6 @@ int oxygen_pcm_init(struct oxygen *chip)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&oxygen_rec_b_ops);
pcm->private_data = chip;
pcm->private_free = oxygen_pcm_free;
strcpy(pcm->name, outs ? "Front Panel" : "Analog 2");
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(chip->pci),
Expand Down

0 comments on commit ef394ac

Please sign in to comment.