aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2017-05-02 09:33:01 -0400
committerMark Brown <broonie@kernel.org>2017-05-14 05:58:03 -0400
commit9f3b777f1de9ff5d17f7259b8f7da5e9d4303e87 (patch)
tree83402f9ac8ff7407377e0b9c3f7fd264e7fa969f
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
ASoC: codecs: msm8916: fix invalid cast to bool type
A function snd_soc_update_bits() is an application of regmap_update_bits_base(). This function takes some arguments for bitmask and new value, thus the arguments should be a type which has width. However bool is used to variable for the argument. This brings truncation and results in invalid operation. This commit fixes this bug by using unsigned int type, instead of bool. This bug is detected by sparse: smsm8916-wcd-analog.c:809:43: warning: odd constant _Bool cast (40 becomes 1) smsm8916-wcd-analog.c:814:43: warning: odd constant _Bool cast (40 becomes 1) Fixes: 585e881e5b9e ("ASoC: codecs: Add msm8916-wcd analog codec") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/msm8916-wcd-analog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c
index d8e8590746af..a78802920c3c 100644
--- a/sound/soc/codecs/msm8916-wcd-analog.c
+++ b/sound/soc/codecs/msm8916-wcd-analog.c
@@ -223,8 +223,8 @@ struct pm8916_wcd_analog_priv {
223 u16 codec_version; 223 u16 codec_version;
224 struct clk *mclk; 224 struct clk *mclk;
225 struct regulator_bulk_data supplies[ARRAY_SIZE(supply_names)]; 225 struct regulator_bulk_data supplies[ARRAY_SIZE(supply_names)];
226 bool micbias1_cap_mode; 226 unsigned int micbias1_cap_mode;
227 bool micbias2_cap_mode; 227 unsigned int micbias2_cap_mode;
228}; 228};
229 229
230static const char *const adc2_mux_text[] = { "ZERO", "INP2", "INP3" }; 230static const char *const adc2_mux_text[] = { "ZERO", "INP2", "INP3" };
@@ -285,7 +285,7 @@ static void pm8916_wcd_analog_micbias_enable(struct snd_soc_codec *codec)
285 285
286static int pm8916_wcd_analog_enable_micbias_ext(struct snd_soc_codec 286static int pm8916_wcd_analog_enable_micbias_ext(struct snd_soc_codec
287 *codec, int event, 287 *codec, int event,
288 int reg, u32 cap_mode) 288 int reg, unsigned int cap_mode)
289{ 289{
290 switch (event) { 290 switch (event) {
291 case SND_SOC_DAPM_POST_PMU: 291 case SND_SOC_DAPM_POST_PMU: