From: bui duc phuc <[email protected]>
Clean up the code using guard() for mutex locks.
Merely code refactoring, and no behavior change.
Signed-off-by: bui duc phuc <[email protected]>
---
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.