[alsa-devel] [PATCH 3/4] ASoC: davinci-mcasp: Return value handling cleanup for mcasp_common_hw_param()

Peter Ujfalusi peter.ujfalusi at ti.com
Thu Jan 30 14:15:24 CET 2014


Take the return value from mcasp_common_hw_param() and use that in case of
error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
---
 sound/soc/davinci/davinci-mcasp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index ae3e40a63e5e..c1c1ac8945d4 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -606,8 +606,10 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
 
 	active_serializers = (channels + slots - 1) / slots;
 
-	if (mcasp_common_hw_param(mcasp, substream->stream, channels) == -EINVAL)
-		return -EINVAL;
+	ret = mcasp_common_hw_param(mcasp, substream->stream, channels);
+	if (ret)
+		return ret;
+
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 		fifo_level = mcasp->txnumevt * active_serializers;
 	else
-- 
1.8.5.3



More information about the Alsa-devel mailing list