Commit 9f3b777f authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Mark Brown

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: 585e881e ("ASoC: codecs: Add msm8916-wcd analog codec")
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ea659a9
...@@ -223,8 +223,8 @@ struct pm8916_wcd_analog_priv { ...@@ -223,8 +223,8 @@ struct pm8916_wcd_analog_priv {
u16 codec_version; u16 codec_version;
struct clk *mclk; struct clk *mclk;
struct regulator_bulk_data supplies[ARRAY_SIZE(supply_names)]; struct regulator_bulk_data supplies[ARRAY_SIZE(supply_names)];
bool micbias1_cap_mode; unsigned int micbias1_cap_mode;
bool micbias2_cap_mode; unsigned int micbias2_cap_mode;
}; };
static const char *const adc2_mux_text[] = { "ZERO", "INP2", "INP3" }; static 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,7 +285,7 @@ static void pm8916_wcd_analog_micbias_enable(struct snd_soc_codec *codec)
static int pm8916_wcd_analog_enable_micbias_ext(struct snd_soc_codec static int pm8916_wcd_analog_enable_micbias_ext(struct snd_soc_codec
*codec, int event, *codec, int event,
int reg, u32 cap_mode) int reg, unsigned int cap_mode)
{ {
switch (event) { switch (event) {
case SND_SOC_DAPM_POST_PMU: case SND_SOC_DAPM_POST_PMU:
......
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