[PATCH 58/78] ASoC: codecs: tas675x: Use guard() for mutex locks

From: phucduc . bui

Date: Thu Jun 18 2026 - 07:11:48 EST


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

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

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

diff --git a/sound/soc/codecs/tas675x.c b/sound/soc/codecs/tas675x.c
index 6f89a422f3c6..c44bf9144e44 100644
--- a/sound/soc/codecs/tas675x.c
+++ b/sound/soc/codecs/tas675x.c
@@ -162,7 +162,7 @@ static int tas675x_dsp_mem_write(struct tas675x_priv *tas, u8 page, u8 reg, u32
* DSP regs in a different book, therefore block
* regmap access before completion.
*/
- mutex_lock(&tas->io_lock);
+ guard(mutex)(&tas->io_lock);

ret = __tas675x_select_book(tas, TAS675X_BOOK_DSP);
if (ret)
@@ -176,7 +176,6 @@ static int tas675x_dsp_mem_write(struct tas675x_priv *tas, u8 page, u8 reg, u32

out:
__tas675x_select_book(tas, TAS675X_BOOK_DEFAULT);
- mutex_unlock(&tas->io_lock);

return ret;
}
@@ -191,7 +190,7 @@ static int tas675x_dsp_mem_read(struct tas675x_priv *tas, u8 page, u8 reg, u32 *
* DSP regs in a different book, therefore block
* regmap access before completion.
*/
- mutex_lock(&tas->io_lock);
+ guard(mutex)(&tas->io_lock);

ret = __tas675x_select_book(tas, TAS675X_BOOK_DSP);
if (ret)
@@ -211,7 +210,6 @@ static int tas675x_dsp_mem_read(struct tas675x_priv *tas, u8 page, u8 reg, u32 *

out:
__tas675x_select_book(tas, TAS675X_BOOK_DEFAULT);
- mutex_unlock(&tas->io_lock);

return ret;
}
--
2.43.0