aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorbui duc phuc <phucduc.bui@gmail.com>2026-07-08 19:50:01 +0700
committerMark Brown <broonie@kernel.org>2026-07-14 12:47:32 +0100
commit1b302f955ecb2831f7fcc626fa6e35dc8d80d9d7 (patch)
treea07a326d40111bfd9549cd473ab7c7a2851394e5
parentASoC: codecs: cs48l32: Use guard() for mutex locks (diff)
ASoC: codecs: cx2072x: 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> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Link: https://patch.msgid.link/20260708125002.202515-25-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/cx2072x.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/codecs/cx2072x.c b/sound/soc/codecs/cx2072x.c
index 83c6cbd40804..908344ee5892 100644
--- a/sound/soc/codecs/cx2072x.c
+++ b/sound/soc/codecs/cx2072x.c
@@ -9,6 +9,7 @@
//
#include <linux/acpi.h>
+#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/gpio.h>
@@ -1408,7 +1409,7 @@ static int cx2072x_jack_status_check(void *data)
unsigned int type = 0;
int state = 0;
- mutex_lock(&cx2072x->lock);
+ guard(mutex)(&cx2072x->lock);
regmap_read(cx2072x->regmap, CX2072X_PORTA_PIN_SENSE, &jack);
jack = jack >> 24;
@@ -1434,8 +1435,6 @@ static int cx2072x_jack_status_check(void *data)
/* clear interrupt */
regmap_write(cx2072x->regmap, CX2072X_UM_INTERRUPT_CRTL_E, 0x12 << 24);
- mutex_unlock(&cx2072x->lock);
-
dev_dbg(codec->dev, "CX2072X_HSDETECT type=0x%X,Jack state = %x\n",
type, state);
return state;