ASoC: codecs: cs47l92: Use guard() for mutex locks

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

Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260708125002.202515-23-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
bui duc phuc 2026-07-08 19:49:59 +07:00 committed by Mark Brown
parent 1b681fda5e
commit f452b00f97
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -6,6 +6,7 @@
// Cirrus Logic International Semiconductor Ltd.
//
#include <linux/cleanup.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
@ -1892,9 +1893,8 @@ static int cs47l92_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)
@ -1922,9 +1922,8 @@ static void cs47l92_component_remove(struct snd_soc_component *component)
struct cs47l92 *cs47l92 = snd_soc_component_get_drvdata(component);
struct madera *madera = cs47l92->core.madera;
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;
wm_adsp2_component_remove(&cs47l92->core.adsp[0], component);
}