linux/sound/soc/cirrus
Jihed Chaibi 622363757b
ASoC: ep93xx: Fix unchecked clk_prepare_enable() and add rollback on failure
ep93xx_i2s_enable() calls clk_prepare_enable() on three clocks in
sequence (mclk, sclk, lrclk) without checking the return value of any
of them. If an intermediate enable fails, the clocks that were already
enabled are never rolled back, leaking them until the next disable cycle
— which may never come if the stream never started cleanly.

Change ep93xx_i2s_enable() from void to int. Add error checking after
each clk_prepare_enable() call and unwind already-enabled clocks on
failure. Propagate the error through ep93xx_i2s_startup() and
ep93xx_i2s_resume(), both of which already return int.

Signed-off-by: Jihed Chaibi <jihed.chaibi.dev@gmail.com>
Fixes: f4ff6b56bc ("ASoC: cirrus: i2s: Prepare clock before using it")
Link: https://patch.msgid.link/20260324210909.45494-1-jihed.chaibi.dev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2026-03-30 19:38:22 +01:00
..
ep93xx-i2s.c ASoC: ep93xx: Fix unchecked clk_prepare_enable() and add rollback on failure 2026-03-30 19:38:22 +01:00
ep93xx-pcm.c ASoC: ep93xx: Drop legacy DMA support 2024-09-12 14:33:11 +00:00
ep93xx-pcm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
Kconfig ASoC: cirrus: Standardize ASoC menu 2025-06-24 01:01:30 +01:00
Makefile ASoC: cirrus: edb93xx: Delete driver 2024-09-12 14:33:12 +00:00