From 96b67f9204fb63168076142777e3cfc2dd236d8c Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 14 Oct 2025 04:27:29 +0000 Subject: [PATCH] ASoC: mediatek: common: use snd_kcontrol_chip() instead of snd_soc_kcontrol_component() We have very similar name functions (A)(B). Both gets component from snd_kcontrol, but (A) is used in callback functions which is registered through snd_soc_add_component_controls(), (B) is used through snd_soc_dapm_new_widgets(). (A) snd_soc_kcontrol_component() (B) snd_soc_dapm_kcontrol_component() (B) is using very picky way to get component but using it is necessary in ASoC. But (A) is just wrapper function to snd_kcontrol_chip(), and directly using it without wrapper is very common way on ALSA. To reduce confusions of similar function, let's use common way on (A). Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87plaqm7ke.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/mediatek/common/mtk-btcvsd.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/mediatek/common/mtk-btcvsd.c b/sound/soc/mediatek/common/mtk-btcvsd.c index d07f288f9752c..5e7e85b4c98a1 100644 --- a/sound/soc/mediatek/common/mtk-btcvsd.c +++ b/sound/soc/mediatek/common/mtk-btcvsd.c @@ -1046,7 +1046,7 @@ static const struct soc_enum btcvsd_enum[] = { static int btcvsd_band_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); ucontrol->value.integer.value[0] = bt->band; @@ -1056,7 +1056,7 @@ static int btcvsd_band_get(struct snd_kcontrol *kcontrol, static int btcvsd_band_set(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; @@ -1071,7 +1071,7 @@ static int btcvsd_band_set(struct snd_kcontrol *kcontrol, static int btcvsd_loopback_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); bool lpbk_en = bt->tx->state == BT_SCO_STATE_LOOPBACK; @@ -1082,7 +1082,7 @@ static int btcvsd_loopback_get(struct snd_kcontrol *kcontrol, static int btcvsd_loopback_set(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); if (ucontrol->value.integer.value[0]) { @@ -1098,7 +1098,7 @@ static int btcvsd_loopback_set(struct snd_kcontrol *kcontrol, static int btcvsd_tx_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); if (!bt->tx) { @@ -1113,7 +1113,7 @@ static int btcvsd_tx_mute_get(struct snd_kcontrol *kcontrol, static int btcvsd_tx_mute_set(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); if (!bt->tx) @@ -1126,7 +1126,7 @@ static int btcvsd_tx_mute_set(struct snd_kcontrol *kcontrol, static int btcvsd_rx_irq_received_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); if (!bt->rx) @@ -1139,7 +1139,7 @@ static int btcvsd_rx_irq_received_get(struct snd_kcontrol *kcontrol, static int btcvsd_rx_timeout_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); if (!bt->rx) @@ -1153,7 +1153,7 @@ static int btcvsd_rx_timeout_get(struct snd_kcontrol *kcontrol, static int btcvsd_rx_timestamp_get(struct snd_kcontrol *kcontrol, unsigned int __user *data, unsigned int size) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); int ret = 0; struct mtk_btcvsd_snd_time_buffer_info time_buffer_info_rx; @@ -1180,7 +1180,7 @@ static int btcvsd_rx_timestamp_get(struct snd_kcontrol *kcontrol, static int btcvsd_tx_irq_received_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); if (!bt->tx) @@ -1193,7 +1193,7 @@ static int btcvsd_tx_irq_received_get(struct snd_kcontrol *kcontrol, static int btcvsd_tx_timeout_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); ucontrol->value.integer.value[0] = bt->tx->timeout; @@ -1203,7 +1203,7 @@ static int btcvsd_tx_timeout_get(struct snd_kcontrol *kcontrol, static int btcvsd_tx_timestamp_get(struct snd_kcontrol *kcontrol, unsigned int __user *data, unsigned int size) { - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); int ret = 0; struct mtk_btcvsd_snd_time_buffer_info time_buffer_info_tx; -- 2.47.3