ASoC: lpass-wsa-macro: add missing test
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 18 Feb 2021 22:29:16 +0000 (16:29 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 13:01:58 +0000 (13:01 +0000)
commit4b4f2119f98518c86c5651771ad9db9070c76de4
treef041c662911128f9e29b46d34dd7b84ff0dc1dbb
parent7faaea14feeeb88177ecf8a640a203c319960d43
ASoC: lpass-wsa-macro: add missing test

cppcheck warning:

sound/soc/codecs/lpass-wsa-macro.c:958:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
 ret = wsa_macro_set_prim_interpolator_rate(dai, (u8) rate_val, sample_rate);
     ^
sound/soc/codecs/lpass-wsa-macro.c:946:6: note: ret is assigned
 ret = wsa_macro_set_mix_interpolator_rate(dai, (u8) rate_val, sample_rate);
     ^
sound/soc/codecs/lpass-wsa-macro.c:958:6: note: ret is overwritten
 ret = wsa_macro_set_prim_interpolator_rate(dai, (u8) rate_val, sample_rate);
     ^

set_mix_interpolator_rate can return -EINVAL, add a test and bail on error.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210218222916.89809-11-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/lpass-wsa-macro.c