Skip to content

Commit

Permalink
ALSA: lola: 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 28d52aa commit 224a40c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions sound/pci/lola/lola_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ static int lola_pcm_hw_params(struct snd_pcm_substream *substream,
str->bufsize = 0;
str->period_bytes = 0;
str->format_verb = 0;
return snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params));
return 0;
}

static int lola_pcm_hw_free(struct snd_pcm_substream *substream)
Expand All @@ -296,7 +295,7 @@ static int lola_pcm_hw_free(struct snd_pcm_substream *substream)
lola_stream_reset(chip, str);
lola_cleanup_slave_streams(pcm, str);
mutex_unlock(&chip->open_mutex);
return snd_pcm_lib_free_pages(substream);
return 0;
}

/*
Expand Down Expand Up @@ -610,9 +609,9 @@ int lola_create_pcm(struct lola *chip)
snd_pcm_set_ops(pcm, i, &lola_pcm_ops);
}
/* buffer pre-allocation */
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
&chip->pci->dev,
1024 * 64, 32 * 1024 * 1024);
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
&chip->pci->dev,
1024 * 64, 32 * 1024 * 1024);
return 0;
}

Expand Down

0 comments on commit 224a40c

Please sign in to comment.