diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-05-28 13:22:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-30 07:33:40 -0400 |
commit | 569ef65a973e19ec3327c8efbcf26bfc844af7e3 (patch) | |
tree | 4d6771752092b199cc9fb3a77add70f33667e009 /sound/soc/blackfin | |
parent | 634426048462373aba69c201390c3e75bc9d00d1 (diff) |
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: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/blackfin')
-rw-r--r-- | sound/soc/blackfin/bf5xx-i2s-pcm.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index 8726c3ad4947..107c1c9b1cb6 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c | |||
@@ -66,10 +66,7 @@ static const struct snd_pcm_hardware bf5xx_pcm_hardware = { | |||
66 | static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream, | 66 | static int bf5xx_pcm_hw_params(struct snd_pcm_substream *substream, |
67 | struct snd_pcm_hw_params *params) | 67 | struct snd_pcm_hw_params *params) |
68 | { | 68 | { |
69 | size_t size = bf5xx_pcm_hardware.buffer_bytes_max; | 69 | return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); |
70 | snd_pcm_lib_malloc_pages(substream, size); | ||
71 | |||
72 | return 0; | ||
73 | } | 70 | } |
74 | 71 | ||
75 | static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream) | 72 | static int bf5xx_pcm_hw_free(struct snd_pcm_substream *substream) |