]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: hisilicon: Use guard() for spin locks
authorbui duc phuc <phucduc.bui@gmail.com>
Fri, 12 Jun 2026 12:31:50 +0000 (19:31 +0700)
committerMark Brown <broonie@kernel.org>
Fri, 12 Jun 2026 13:20:37 +0000 (14:20 +0100)
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/20260612123150.74696-1-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/hisilicon/hi6210-i2s.c

index 250ae3781d14067d73de0f915263cc2323b6bdd6..33b1dafb2540aaea92a45a861b4afd91784d7693 100644 (file)
@@ -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)