mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
ASoC: mediatek: mt8195: mt8365-dai-adda: 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-10-phucduc.bui@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
befae7299a
commit
754c2fbf8b
|
|
@ -63,10 +63,9 @@ static int mt8365_dai_set_adda_in(struct mtk_base_afe *afe, unsigned int rate)
|
|||
|
||||
int mt8365_dai_enable_adda_on(struct mtk_base_afe *afe)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct mt8365_afe_private *afe_priv = afe->platform_priv;
|
||||
|
||||
spin_lock_irqsave(&afe_priv->afe_ctrl_lock, flags);
|
||||
guard(spinlock_irqsave)(&afe_priv->afe_ctrl_lock);
|
||||
|
||||
adda_afe_on_ref_cnt++;
|
||||
if (adda_afe_on_ref_cnt == 1)
|
||||
|
|
@ -74,17 +73,14 @@ int mt8365_dai_enable_adda_on(struct mtk_base_afe *afe)
|
|||
AFE_ADDA_UL_DL_ADDA_AFE_ON,
|
||||
AFE_ADDA_UL_DL_ADDA_AFE_ON);
|
||||
|
||||
spin_unlock_irqrestore(&afe_priv->afe_ctrl_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mt8365_dai_disable_adda_on(struct mtk_base_afe *afe)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct mt8365_afe_private *afe_priv = afe->platform_priv;
|
||||
|
||||
spin_lock_irqsave(&afe_priv->afe_ctrl_lock, flags);
|
||||
guard(spinlock_irqsave)(&afe_priv->afe_ctrl_lock);
|
||||
|
||||
adda_afe_on_ref_cnt--;
|
||||
if (adda_afe_on_ref_cnt == 0)
|
||||
|
|
@ -96,8 +92,6 @@ int mt8365_dai_disable_adda_on(struct mtk_base_afe *afe)
|
|||
dev_warn(afe->dev, "Abnormal adda_on ref count. Force it to 0\n");
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&afe_priv->afe_ctrl_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user