aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2018-02-14 10:15:31 +0300
committerMark Brown <[email protected]>2018-02-14 11:47:15 +0000
commit21957b5bf0ff607e6e0ed55a3a89454e969511ba (patch)
tree3d5e4ce733e8a135b3ba2de2485b22f84dbdd6f5
parent2b5803b95977d60f6e3c88672969b1da024fc3e8 (diff)
ASoC: uniphier: fix an error code in uniphier_aio_comprdma_new()
The dma_mapping_error() returns true or false, but we want to return -ENOMEM if there was an error. Fixes: e98131222ff9 ("ASoC: uniphier: add support for UniPhier AIO compress audio") Signed-off-by: Dan Carpenter <[email protected]> Tested-by: Katsuhiro Suzuki <[email protected]> Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/uniphier/aio-compress.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/uniphier/aio-compress.c b/sound/soc/uniphier/aio-compress.c
index 7f7abe3ae99d..4751c8bdabec 100644
--- a/sound/soc/uniphier/aio-compress.c
+++ b/sound/soc/uniphier/aio-compress.c
@@ -54,12 +54,11 @@ static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd)
dma_dir = DMA_TO_DEVICE;
sub->compr_addr = dma_map_single(dev, sub->compr_area, size, dma_dir);
- ret = dma_mapping_error(dev, sub->compr_addr);
- if (ret) {
+ if (dma_mapping_error(dev, sub->compr_addr)) {
kfree(sub->compr_area);
sub->compr_area = NULL;
- return ret;
+ return -ENOMEM;
}
sub->compr_bytes = size;