[PATCH 5/6] ASoC: rt721-sdca: always cancel jack work on remove
From: Jiale Yao
Date: Fri Sep 25 2026 - 10:51:37 EST
rt721_sdca_sdw_remove() cancels the jack work only when hw_init is true.
rt721_sdca_update_status() clears hw_init when the SoundWire slave
becomes unattached, but jack work may already have been queued by
rt721_sdca_interrupt_callback() or the jack initialization path.
A remove after that status update can therefore skip the cancellation and
leave delayed work pending after the codec private data has been freed.
The work objects are initialized during probe, so cancel them
unconditionally instead of relying on the mutable hw_init state.
Fixes: 86ce355c1f9a ("ASoC: rt721-sdca: Add RT721 SDCA driver")
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
sound/soc/codecs/rt721-sdca-sdw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/codecs/rt721-sdca-sdw.c b/sound/soc/codecs/rt721-sdca-sdw.c
index 910583162d3e..c65e4d1369c9 100644
--- a/sound/soc/codecs/rt721-sdca-sdw.c
+++ b/sound/soc/codecs/rt721-sdca-sdw.c
@@ -422,10 +422,8 @@ static void rt721_sdca_sdw_remove(struct sdw_slave *slave)
{
struct rt721_sdca_priv *rt721 = dev_get_drvdata(&slave->dev);
- if (rt721->hw_init) {
- cancel_delayed_work_sync(&rt721->jack_detect_work);
- cancel_delayed_work_sync(&rt721->jack_btn_check_work);
- }
+ cancel_delayed_work_sync(&rt721->jack_detect_work);
+ cancel_delayed_work_sync(&rt721->jack_btn_check_work);
if (rt721->first_hw_init)
pm_runtime_disable(&slave->dev);
--
2.34.1