Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 56efaed5 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown
Browse files

ASoC: rt5663: refine error handling



The newly added rt5663 codec driver introduces a couple of warnings
when built with -Wmaybe-uninitialized:

codecs/rt5663.c: In function 'rt5663_set_tdm_slot':
codecs/rt5663.c:2680:2: error: 'reg' may be used uninitialized in this function [-Werror=maybe-uninitialized]
codecs/rt5663.c: In function 'rt5663_set_dai_pll':
codecs/rt5663.c:2556:12: error: 'shift' may be used uninitialized in this function [-Werror=maybe-uninitialized]
codecs/rt5663.c:2596:2: error: 'mask' may be used uninitialized in this function [-Werror=maybe-uninitialized]

We can avoid those warnings by always returning an error
from the switch() statements instead of falling through
with an uninitialized variable when we hit an unexpected
case.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: df7c5216 ("ASoC: add rt5663 codec driver")
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent df7c5216
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment