Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: rt721-sdca: Fix issue of warning message

Fix issue of warning messages caused by some variables.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
Link: https://patch.msgid.link/065c0b7d84cf47d3a9186235447521c5@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Jack Yu and committed by
Mark Brown
e5553cb6 53189ae7

+3 -3
+1 -1
sound/soc/codecs/rt-sdw-common.c
··· 108 108 int rt_sdca_btn_type(unsigned char *buffer) 109 109 { 110 110 u8 btn_type = 0; 111 - int ret; 111 + int ret = 0; 112 112 113 113 btn_type |= buffer[0] & 0xf; 114 114 btn_type |= (buffer[0] >> 4) & 0xf;
+2 -2
sound/soc/codecs/rt721-sdca.c
··· 30 30 { 31 31 struct rt721_sdca_priv *rt721 = 32 32 container_of(work, struct rt721_sdca_priv, jack_detect_work.work); 33 - int btn_type = 0, ret; 33 + int btn_type = 0; 34 34 35 35 if (!rt721->hs_jack) 36 36 return; ··· 42 42 if (rt721->scp_sdca_stat1 & SDW_SCP_SDCA_INT_SDCA_6) { 43 43 rt721->jack_type = rt_sdca_headset_detect(rt721->regmap, 44 44 RT721_SDCA_ENT_GE49); 45 - if (ret < 0) 45 + if (rt721->jack_type < 0) 46 46 return; 47 47 } 48 48