Commit 569ef65a authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

ASoC: blackfin: bf5xx-i2s: Allocate buffer only as large as requested

There is no need to always allocate the maximum buffer size. While we are at it
also pass errors returned by snd_pcm_lib_malloc_pages() on to the upper layers.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 63442604
...@@ -66,10 +66,7 @@ static const struct snd_pcm_hardware bf5xx_pcm_hardware = { ...@@ -66,10 +66,7 @@ static const struct snd_pcm_hardware bf5xx_pcm_hardware = {
static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream, static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params) struct snd_pcm_hw_params *params)
{ {
size_t size = bf5xx_pcm_hardware.buffer_bytes_max; return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
snd_pcm_lib_malloc_pages(substream, size);
return 0;
} }
static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream) static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream)
......
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