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 <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20260610102021.83273-11-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
bui duc phuc 2026-06-10 17:20:21 +07:00 committed by Mark Brown
parent 754c2fbf8b
commit 62bde3771c
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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,