Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: hisilicon: Use guard() for spin locks
@ 2026-06-12 12:31 phucduc.bui
  2026-06-12 13:20 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: phucduc.bui @ 2026-06-12 12:31 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
	linux-kernel, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

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>
---
 sound/soc/hisilicon/hi6210-i2s.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/hisilicon/hi6210-i2s.c b/sound/soc/hisilicon/hi6210-i2s.c
index 250ae3781d14..33b1dafb2540 100644
--- a/sound/soc/hisilicon/hi6210-i2s.c
+++ b/sound/soc/hisilicon/hi6210-i2s.c
@@ -185,7 +185,7 @@ static void hi6210_i2s_txctrl(struct snd_soc_dai *cpu_dai, int on)
 	struct hi6210_i2s *i2s = dev_get_drvdata(cpu_dai->dev);
 	u32 val;
 
-	spin_lock(&i2s->lock);
+	guard(spinlock)(&i2s->lock);
 	if (on) {
 		/* enable S2 TX */
 		val = hi6210_read_reg(i2s, HII2S_I2S_CFG);
@@ -197,7 +197,6 @@ static void hi6210_i2s_txctrl(struct snd_soc_dai *cpu_dai, int on)
 		val &= ~HII2S_I2S_CFG__S2_IF_TX_EN;
 		hi6210_write_reg(i2s, HII2S_I2S_CFG, val);
 	}
-	spin_unlock(&i2s->lock);
 }
 
 static void hi6210_i2s_rxctrl(struct snd_soc_dai *cpu_dai, int on)
@@ -205,7 +204,7 @@ static void hi6210_i2s_rxctrl(struct snd_soc_dai *cpu_dai, int on)
 	struct hi6210_i2s *i2s = dev_get_drvdata(cpu_dai->dev);
 	u32 val;
 
-	spin_lock(&i2s->lock);
+	guard(spinlock)(&i2s->lock);
 	if (on) {
 		val = hi6210_read_reg(i2s, HII2S_I2S_CFG);
 		val |= HII2S_I2S_CFG__S2_IF_RX_EN;
@@ -215,7 +214,6 @@ static void hi6210_i2s_rxctrl(struct snd_soc_dai *cpu_dai, int on)
 		val &= ~HII2S_I2S_CFG__S2_IF_RX_EN;
 		hi6210_write_reg(i2s, HII2S_I2S_CFG, val);
 	}
-	spin_unlock(&i2s->lock);
 }
 
 static int hi6210_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: hisilicon: Use guard() for spin locks
  2026-06-12 12:31 [PATCH] ASoC: hisilicon: Use guard() for spin locks phucduc.bui
@ 2026-06-12 13:20 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2026-06-12 13:20 UTC (permalink / raw)
  To: phucduc.bui
  Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, linux-sound,
	linux-kernel

On Fri, 12 Jun 2026 19:31:50 +0700, phucduc.bui@gmail.com wrote:
> ASoC: hisilicon: Use guard() for spin locks

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2

Thanks!

[1/1] ASoC: hisilicon: Use guard() for spin locks
      https://git.kernel.org/broonie/sound/c/da6899fc88e4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-12 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 12:31 [PATCH] ASoC: hisilicon: Use guard() for spin locks phucduc.bui
2026-06-12 13:20 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox