[bug report] ASoC: codecs: wcd938x: add capture dapm widgets
Dan Carpenter
dan.carpenter at oracle.com
Fri Jun 18 11:17:03 CEST 2021
Hello Srinivas Kandagatla,
The patch d5add08fcbce: "ASoC: codecs: wcd938x: add capture dapm
widgets" from Jun 9, 2021, leads to the following static checker
warning:
sound/soc/codecs/wcd938x.c:2189 wcd938x_tx_channel_config()
error: uninitialized symbol 'reg'.
sound/soc/codecs/wcd938x.c
2165 static void wcd938x_tx_channel_config(struct snd_soc_component *component,
2166 int channel, int mode)
2167 {
2168 int reg, mask;
2169
2170 switch (channel) {
2171 case 0:
2172 reg = WCD938X_ANA_TX_CH2;
2173 mask = WCD938X_HPF1_INIT_MASK;
2174 break;
2175 case 1:
2176 reg = WCD938X_ANA_TX_CH2;
2177 mask = WCD938X_HPF2_INIT_MASK;
2178 break;
2179 case 2:
2180 reg = WCD938X_ANA_TX_CH4;
2181 mask = WCD938X_HPF3_INIT_MASK;
2182 break;
2183 case 3:
2184 reg = WCD938X_ANA_TX_CH4;
2185 mask = WCD938X_HPF4_INIT_MASK;
2186 break;
We could add a default case?
default:
return;
2187 }
2188
2189 snd_soc_component_write_field(component, reg, mask, mode);
2190 }
regards,
dan carpenter
More information about the Alsa-devel
mailing list