[PATCH 19/78] ASoC: codecs: cs47l35: Use guard() for mutex locks
phucduc.bui at gmail.com
phucduc.bui at gmail.com
Wed Jun 17 03:31:36 PDT 2026
From: bui duc phuc <phucduc.bui at gmail.com>
Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.
Signed-off-by: bui duc phuc <phucduc.bui at gmail.com>
---
sound/soc/codecs/cs47l35.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/cs47l35.c b/sound/soc/codecs/cs47l35.c
index a8fe5a99a8bb..c22de7356ce7 100644
--- a/sound/soc/codecs/cs47l35.c
+++ b/sound/soc/codecs/cs47l35.c
@@ -1566,9 +1566,8 @@ static int cs47l35_component_probe(struct snd_soc_component *component)
snd_soc_component_init_regmap(component, madera->regmap);
- mutex_lock(&madera->dapm_ptr_lock);
- madera->dapm = snd_soc_component_to_dapm(component);
- mutex_unlock(&madera->dapm_ptr_lock);
+ scoped_guard(mutex, &madera->dapm_ptr_lock)
+ madera->dapm = snd_soc_component_to_dapm(component);
ret = madera_init_inputs(component);
if (ret)
@@ -1600,9 +1599,8 @@ static void cs47l35_component_remove(struct snd_soc_component *component)
struct madera *madera = cs47l35->core.madera;
int i;
- mutex_lock(&madera->dapm_ptr_lock);
- madera->dapm = NULL;
- mutex_unlock(&madera->dapm_ptr_lock);
+ scoped_guard(mutex, &madera->dapm_ptr_lock)
+ madera->dapm = NULL;
for (i = 0; i < CS47L35_NUM_ADSP; i++)
wm_adsp2_component_remove(&cs47l35->core.adsp[i], component);
--
2.43.0
More information about the linux-arm-kernel
mailing list