Commit 5c855c8e2be67f2d5a989ef1190098f924f9f820

Authored by Wei Yongjun
Committed by Mark Brown
1 parent 3d70f8c617

ASoC: cs42l52: fix the return value of cs42l52_set_fmt()

Fix the return value of cs42l52_set_fmt() when clock inversion is
not allowed and also remove the useless variable ret.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

[We had been assigning to ret but then ignoring the value we assgined
-- broonie]

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

sound/soc/codecs/cs42l52.c
... ... @@ -773,7 +773,6 @@
773 773 {
774 774 struct snd_soc_codec *codec = codec_dai->codec;
775 775 struct cs42l52_private *cs42l52 = snd_soc_codec_get_drvdata(codec);
776   - int ret = 0;
777 776 u8 iface = 0;
778 777  
779 778 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
... ... @@ -822,7 +821,7 @@
822 821 case SND_SOC_DAIFMT_NB_IF:
823 822 break;
824 823 default:
825   - ret = -EINVAL;
  824 + return -EINVAL;
826 825 }
827 826 cs42l52->config.format = iface;
828 827 snd_soc_write(codec, CS42L52_IFACE_CTL1, cs42l52->config.format);