ASoC: soc-generic-dmaengine-pcm: Fix error handling

Remove the return value checking, that is to align with the code
before adding snd_dmaengine_pcm_refine_runtime_hwparams function.

Otherwise it causes a regression on the HiKey board:

[   17.721424] hi6210_i2s f7118000.i2s: ASoC: can't open component f7118000.i2s: -6

Fixes: e957204e73 ("ASoC: pcm_dmaengine: Extract snd_dmaengine_pcm_refine_runtime_hwparams")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reported-by: John Stultz <john.stultz@linaro.org>
Link: https://lore.kernel.org/r/1579505286-32085-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Shengjiu Wang 2020-01-20 15:28:06 +08:00 committed by Mark Brown
parent af4bac1153
commit 130128098a
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -117,7 +117,6 @@ dmaengine_pcm_set_runtime_hwparams(struct snd_soc_component *component,
struct dma_chan *chan = pcm->chan[substream->stream];
struct snd_dmaengine_dai_dma_data *dma_data;
struct snd_pcm_hardware hw;
int ret;
if (pcm->config && pcm->config->pcm_hardware)
return snd_soc_set_runtime_hwparams(substream,
@ -138,12 +137,15 @@ dmaengine_pcm_set_runtime_hwparams(struct snd_soc_component *component,
if (pcm->flags & SND_DMAENGINE_PCM_FLAG_NO_RESIDUE)
hw.info |= SNDRV_PCM_INFO_BATCH;
ret = snd_dmaengine_pcm_refine_runtime_hwparams(substream,
dma_data,
&hw,
chan);
if (ret)
return ret;
/**
* FIXME: Remove the return value check to align with the code
* before adding snd_dmaengine_pcm_refine_runtime_hwparams
* function.
*/
snd_dmaengine_pcm_refine_runtime_hwparams(substream,
dma_data,
&hw,
chan);
return snd_soc_set_runtime_hwparams(substream, &hw);
}