]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ASoC: adau1372: Fix clock leak on PLL lock failure
authorJihed Chaibi <jihed.chaibi.dev@gmail.com>
Wed, 25 Mar 2026 21:07:04 +0000 (22:07 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 26 Mar 2026 10:33:36 +0000 (10:33 +0000)
commitbfe6a264effcb6fe99ad7ceaf9e8c7439fc9555b
treee7ed1578d50fe148904da6efd8cc466e4740c0de
parent326fe8104a4020d30080d37ac8b6b43893cdebca
ASoC: adau1372: Fix clock leak on PLL lock failure

adau1372_enable_pll() was a void function that logged a dev_err() on
PLL lock timeout but did not propagate the error. As a result,
adau1372_set_power() would continue with adau1372->enabled set to true
despite the PLL being unlocked, and the mclk left enabled with no
corresponding disable on the error path.

Convert adau1372_enable_pll() to return int, using -ETIMEDOUT on lock
timeout and propagating regmap errors directly. In adau1372_set_power(),
check the return value and unwind in reverse order: restore regcache to
cache-only mode, reassert GPIO power-down, and disable the clock before
returning the error.

Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>
Fixes: 6cd4c6459e47 ("ASoC: Add ADAU1372 audio CODEC support")
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20260325210704.76847-3-jihed.chaibi.dev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/adau1372.c