summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbui duc phuc <phucduc.bui@gmail.com>2026-07-31 10:06:43 +0700
committerMark Brown <broonie@kernel.org>2026-07-31 16:31:05 +0100
commitb6eda65e115f999eaffad4eb028e356cec45bab7 (patch)
treeb175246a19d03aec4eb2cfd74b11bf838de2796c
parent06b3eee8ac1ebc756858ab2a8df1488707a82a55 (diff)
downloadlinux-next-b6eda65e115f999eaffad4eb028e356cec45bab7.tar.gz
linux-next-b6eda65e115f999eaffad4eb028e356cec45bab7.zip
ASoC: codecs: wm8958: Use guard() for mutex locks
Clean up the code using guard() for mutex locks. Merely code refactoring, and no behavior change. Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20260731030648.8706-22-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/wm8958-dsp2.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c
index 8ff0882732e7..f75a6dc9d2bb 100644
--- a/sound/soc/codecs/wm8958-dsp2.c
+++ b/sound/soc/codecs/wm8958-dsp2.c
@@ -7,6 +7,7 @@
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
*/
+#include <linux/cleanup.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
@@ -864,9 +865,8 @@ static void wm8958_enh_eq_loaded(const struct firmware *fw, void *context)
struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
if (fw && (wm8958_dsp2_fw(component, "ENH_EQ", fw, true) == 0)) {
- mutex_lock(&wm8994->fw_lock);
+ guard(mutex)(&wm8994->fw_lock);
wm8994->enh_eq = fw;
- mutex_unlock(&wm8994->fw_lock);
}
}
@@ -876,9 +876,8 @@ static void wm8958_mbc_vss_loaded(const struct firmware *fw, void *context)
struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
if (fw && (wm8958_dsp2_fw(component, "MBC+VSS", fw, true) == 0)) {
- mutex_lock(&wm8994->fw_lock);
+ guard(mutex)(&wm8994->fw_lock);
wm8994->mbc_vss = fw;
- mutex_unlock(&wm8994->fw_lock);
}
}
@@ -888,9 +887,8 @@ static void wm8958_mbc_loaded(const struct firmware *fw, void *context)
struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
if (fw && (wm8958_dsp2_fw(component, "MBC", fw, true) == 0)) {
- mutex_lock(&wm8994->fw_lock);
+ guard(mutex)(&wm8994->fw_lock);
wm8994->mbc = fw;
- mutex_unlock(&wm8994->fw_lock);
}
}