Commit 87b56172 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown

ASoC: codecs: aw88261: avoid uninitialized variable warning

aw88261_reg_update() returns an unintialized error code in the
success path:

sound/soc/codecs/aw88261.c:651:7: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
                if (aw_dev->prof_cur != aw_dev->prof_index) {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/codecs/aw88261.c:660:9: note: uninitialized use occurs here
        return ret;
               ^~~
sound/soc/codecs/aw88261.c:651:3: note: remove the 'if' if its condition is always true
                if (aw_dev->prof_cur != aw_dev->prof_index) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Return zero instead here.

Fixes: 028a2ae2 ("ASoC: codecs: Add aw88261 amplifier driver")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230808125703.1611325-1-arnd@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7f5cf197
......@@ -652,6 +652,8 @@ static int aw88261_reg_update(struct aw88261 *aw88261, bool force)
ret = aw88261_dev_fw_update(aw88261);
if (ret)
return ret;
} else {
ret = 0;
}
}
......
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