From 62bde3771c3b83587a4549c92111d141954806c4 Mon Sep 17 00:00:00 2001 From: bui duc phuc Date: Wed, 10 Jun 2026 17:20:21 +0700 Subject: [PATCH] ASoC: mediatek: mt8195: mt8365-dai-i2s: 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 Link: https://patch.msgid.link/20260610102021.83273-11-phucduc.bui@gmail.com Signed-off-by: Mark Brown --- sound/soc/mediatek/mt8365/mt8365-dai-i2s.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c b/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c index cb9beb172ed5..a058973662b3 100644 --- a/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c +++ b/sound/soc/mediatek/mt8365/mt8365-dai-i2s.c @@ -463,7 +463,6 @@ static int mt8365_afe_set_2nd_i2s_asrc_enable(struct mtk_base_afe *afe, void mt8365_afe_set_i2s_out_enable(struct mtk_base_afe *afe, bool enable) { int i; - unsigned long flags; struct mt8365_afe_private *afe_priv = afe->platform_priv; struct mtk_afe_i2s_priv *i2s_data = NULL; @@ -475,7 +474,7 @@ void mt8365_afe_set_i2s_out_enable(struct mtk_base_afe *afe, bool enable) if (!i2s_data) return; - spin_lock_irqsave(&afe_priv->afe_ctrl_lock, flags); + guard(spinlock_irqsave)(&afe_priv->afe_ctrl_lock); if (enable) { i2s_data->i2s_out_on_ref_cnt++; @@ -490,8 +489,6 @@ void mt8365_afe_set_i2s_out_enable(struct mtk_base_afe *afe, bool enable) else if (i2s_data->i2s_out_on_ref_cnt < 0) i2s_data->i2s_out_on_ref_cnt = 0; } - - spin_unlock_irqrestore(&afe_priv->afe_ctrl_lock, flags); } static void mt8365_dai_set_enable(struct mtk_base_afe *afe,