[PATCH 09/20] ASoC: Intel: avs: icl: Use guard() for spin locks

From: phucduc . bui

Date: Thu Jun 11 2026 - 08:01:04 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/intel/avs/icl.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sound/soc/intel/avs/icl.c b/sound/soc/intel/avs/icl.c
index d655e727bebd..4d425846b56e 100644
--- a/sound/soc/intel/avs/icl.c
+++ b/sound/soc/intel/avs/icl.c
@@ -166,15 +166,13 @@ int avs_icl_load_basefw(struct avs_dev *adev, struct firmware *fw)

snd_hdac_chip_updateb(bus, VS_LTRP, AZX_REG_VS_LTRP_GB_MASK, ICL_VS_LTRP_GB_ICCMAX);

- spin_lock(&bus->reg_lock);
- snd_hdac_stream_start(hdac_stream(host_stream));
- spin_unlock(&bus->reg_lock);
+ scoped_guard(spinlock, &bus->reg_lock)
+ snd_hdac_stream_start(hdac_stream(host_stream));

ret = avs_hda_load_basefw(adev, fw);

- spin_lock(&bus->reg_lock);
- snd_hdac_stream_stop(hdac_stream(host_stream));
- spin_unlock(&bus->reg_lock);
+ scoped_guard(spinlock, &bus->reg_lock)
+ snd_hdac_stream_stop(hdac_stream(host_stream));

snd_hdac_dsp_cleanup(hdac_stream(host_stream), &dmab);

--
2.43.0