From: bui duc phuc <[email protected]>

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

Signed-off-by: bui duc phuc <[email protected]>
---
 sound/soc/fsl/fsl_audmix.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c
index 40a3b7432174..066239c64037 100644
--- a/sound/soc/fsl/fsl_audmix.c
+++ b/sound/soc/fsl/fsl_audmix.c
@@ -280,7 +280,6 @@ static int fsl_audmix_dai_trigger(struct snd_pcm_substream 
*substream, int cmd,
                                  struct snd_soc_dai *dai)
 {
        struct fsl_audmix *priv = snd_soc_dai_get_drvdata(dai);
-       unsigned long lock_flags;
 
        /* Capture stream shall not be handled */
        if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
@@ -290,16 +289,14 @@ static int fsl_audmix_dai_trigger(struct 
snd_pcm_substream *substream, int cmd,
        case SNDRV_PCM_TRIGGER_START:
        case SNDRV_PCM_TRIGGER_RESUME:
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-               spin_lock_irqsave(&priv->lock, lock_flags);
-               priv->tdms |= BIT(dai->driver->id);
-               spin_unlock_irqrestore(&priv->lock, lock_flags);
+               scoped_guard(spinlock_irqsave, &priv->lock)
+                       priv->tdms |= BIT(dai->driver->id);
                break;
        case SNDRV_PCM_TRIGGER_STOP:
        case SNDRV_PCM_TRIGGER_SUSPEND:
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-               spin_lock_irqsave(&priv->lock, lock_flags);
-               priv->tdms &= ~BIT(dai->driver->id);
-               spin_unlock_irqrestore(&priv->lock, lock_flags);
+               scoped_guard(spinlock_irqsave, &priv->lock)
+                       priv->tdms &= ~BIT(dai->driver->id);
                break;
        default:
                return -EINVAL;
-- 
2.43.0


Reply via email to