Commit d245fff1 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Mark Brown

ASoC: codecs: wcd938x: fix uninitialized symbol warnings

This patch fixes below two uninitialized symbol warnings

warning:
	sound/soc/codecs/wcd938x.c:2092 wcd938x_tx_swr_ctrl()
	error: uninitialized symbol 'rate'

	sound/soc/codecs/wcd938x.c:2189 wcd938x_tx_channel_config()
	error: uninitialized symbol 'reg'.

First one my brining in check to already existing if condition and
second one by adding a default switch case to avoid any access to reg.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210621134502.19537-2-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8c4863c2
...@@ -2085,11 +2085,9 @@ static int wcd938x_tx_swr_ctrl(struct snd_soc_dapm_widget *w, ...@@ -2085,11 +2085,9 @@ static int wcd938x_tx_swr_ctrl(struct snd_soc_dapm_widget *w,
} }
rate = wcd938x_get_clk_rate(i); rate = wcd938x_get_clk_rate(i);
wcd938x_set_swr_clk_rate(component, rate, bank); wcd938x_set_swr_clk_rate(component, rate, bank);
}
if (strnstr(w->name, "ADC", sizeof("ADC")))
/* Copy clk settings to active bank */ /* Copy clk settings to active bank */
wcd938x_set_swr_clk_rate(component, rate, !bank); wcd938x_set_swr_clk_rate(component, rate, !bank);
}
break; break;
case SND_SOC_DAPM_POST_PMD: case SND_SOC_DAPM_POST_PMD:
if (strnstr(w->name, "ADC", sizeof("ADC"))) { if (strnstr(w->name, "ADC", sizeof("ADC"))) {
...@@ -2184,6 +2182,8 @@ static void wcd938x_tx_channel_config(struct snd_soc_component *component, ...@@ -2184,6 +2182,8 @@ static void wcd938x_tx_channel_config(struct snd_soc_component *component,
reg = WCD938X_ANA_TX_CH4; reg = WCD938X_ANA_TX_CH4;
mask = WCD938X_HPF4_INIT_MASK; mask = WCD938X_HPF4_INIT_MASK;
break; break;
default:
return;
} }
snd_soc_component_write_field(component, reg, mask, mode); snd_soc_component_write_field(component, reg, mask, mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment