Skip to content

Commit

Permalink
ALSA: riptide: Use managed buffer allocation
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Dec 11, 2019
1 parent fdaad16 commit 0dd3236
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sound/pci/riptide/riptide.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,8 +1558,7 @@ snd_riptide_hw_params(struct snd_pcm_substream *substream,
return err;
}
data->sgdbuf = (struct sgd *)sgdlist->area;
return snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params));
return 0;
}

static int snd_riptide_hw_free(struct snd_pcm_substream *substream)
Expand All @@ -1581,7 +1580,7 @@ static int snd_riptide_hw_free(struct snd_pcm_substream *substream)
data->sgdlist.area = NULL;
}
}
return snd_pcm_lib_free_pages(substream);
return 0;
}

static int snd_riptide_playback_open(struct snd_pcm_substream *substream)
Expand Down Expand Up @@ -1692,9 +1691,8 @@ static int snd_riptide_pcm(struct snd_riptide *chip, int device)
pcm->info_flags = 0;
strcpy(pcm->name, "RIPTIDE");
chip->pcm = pcm;
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;
}

Expand Down

0 comments on commit 0dd3236

Please sign in to comment.