summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbui duc phuc <phucduc.bui@gmail.com>2026-06-04 06:35:52 +0300
committerMark Brown <broonie@kernel.org>2026-06-11 22:50:29 +0300
commitec22437fc41aa60a0b61ab418eea0c020fa3afac (patch)
tree134a8e2ecc1fdde42d7f8db65d67e3e259861cbc
parent4bda5af169202c1298492fa91e58903c65a68234 (diff)
downloadlinux-ec22437fc41aa60a0b61ab418eea0c020fa3afac.tar.xz
ASoC: rockchip: i2s-tdm: Use guard() for spin locks
Clean up the code using guard() for spin locks. Merely code refactoring, and no behavior change. Signed-off-by: bui duc phuc <phucduc.bui@gmail.com> Link: https://patch.msgid.link/20260604033554.96996-3-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/rockchip/rockchip_i2s_tdm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
index fc52149ed6ae..3f3db28b8940 100644
--- a/sound/soc/rockchip/rockchip_i2s_tdm.c
+++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
@@ -285,9 +285,8 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai, int on)
{
struct rk_i2s_tdm_dev *i2s_tdm = to_info(dai);
- unsigned long flags;
- spin_lock_irqsave(&i2s_tdm->lock, flags);
+ guard(spinlock_irqsave)(&i2s_tdm->lock);
if (on) {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
rockchip_enable_tde(i2s_tdm->regmap);
@@ -313,7 +312,6 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream,
I2S_CLR_TXC | I2S_CLR_RXC);
}
}
- spin_unlock_irqrestore(&i2s_tdm->lock, flags);
}
static void rockchip_snd_txctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
@@ -587,12 +585,11 @@ static int rockchip_i2s_trcm_mode(struct snd_pcm_substream *substream,
unsigned int fmt)
{
struct rk_i2s_tdm_dev *i2s_tdm = to_info(dai);
- unsigned long flags;
if (!i2s_tdm->clk_trcm)
return 0;
- spin_lock_irqsave(&i2s_tdm->lock, flags);
+ guard(spinlock_irqsave)(&i2s_tdm->lock);
if (i2s_tdm->refcount)
rockchip_i2s_tdm_xfer_pause(substream, i2s_tdm);
@@ -614,7 +611,6 @@ static int rockchip_i2s_trcm_mode(struct snd_pcm_substream *substream,
if (i2s_tdm->refcount)
rockchip_i2s_tdm_xfer_resume(substream, i2s_tdm);
- spin_unlock_irqrestore(&i2s_tdm->lock, flags);
return 0;
}