[PATCH 1/3] ASoC: mediatek: mt2701: Use devm_clk_get_optional() for audio_mrgif_pd

From: phucduc . bui

Date: Mon Aug 17 2026 - 06:50:05 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

The audio_mrgif_pd clock is optional as some platforms may support the
BT path while others do not. Use devm_clk_get_optional() to reflect
this.

Propagate other errors to the caller.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
index d217f9320ad2..18f0f27bd8c0 100644
--- a/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
+++ b/sound/soc/mediatek/mt2701/mt2701-afe-clock-ctrl.c
@@ -89,13 +89,9 @@ int mt2701_init_clock(struct mtk_base_afe *afe)
}

/* Some platforms may support BT path */
- afe_priv->mrgif_ck = devm_clk_get(afe->dev, "audio_mrgif_pd");
- if (IS_ERR(afe_priv->mrgif_ck)) {
- if (PTR_ERR(afe_priv->mrgif_ck) == -EPROBE_DEFER)
- return -EPROBE_DEFER;
-
- afe_priv->mrgif_ck = NULL;
- }
+ afe_priv->mrgif_ck = devm_clk_get_optional(afe->dev, "audio_mrgif_pd");
+ if (IS_ERR(afe_priv->mrgif_ck))
+ return PTR_ERR(afe_priv->mrgif_ck);

/*
* Optional HDMI audio clocks. Platforms that do not wire up the
--
2.43.0