Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87plaqm7ke.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
96b67f92 9bce11a3

+12 -12
+12 -12
sound/soc/mediatek/common/mtk-btcvsd.c
··· 1046 1046 static int btcvsd_band_get(struct snd_kcontrol *kcontrol, 1047 1047 struct snd_ctl_elem_value *ucontrol) 1048 1048 { 1049 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1049 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1050 1050 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1051 1051 1052 1052 ucontrol->value.integer.value[0] = bt->band; ··· 1056 1056 static int btcvsd_band_set(struct snd_kcontrol *kcontrol, 1057 1057 struct snd_ctl_elem_value *ucontrol) 1058 1058 { 1059 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1059 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1060 1060 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1061 1061 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 1062 1062 ··· 1071 1071 static int btcvsd_loopback_get(struct snd_kcontrol *kcontrol, 1072 1072 struct snd_ctl_elem_value *ucontrol) 1073 1073 { 1074 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1074 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1075 1075 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1076 1076 bool lpbk_en = bt->tx->state == BT_SCO_STATE_LOOPBACK; 1077 1077 ··· 1082 1082 static int btcvsd_loopback_set(struct snd_kcontrol *kcontrol, 1083 1083 struct snd_ctl_elem_value *ucontrol) 1084 1084 { 1085 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1085 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1086 1086 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1087 1087 1088 1088 if (ucontrol->value.integer.value[0]) { ··· 1098 1098 static int btcvsd_tx_mute_get(struct snd_kcontrol *kcontrol, 1099 1099 struct snd_ctl_elem_value *ucontrol) 1100 1100 { 1101 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1101 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1102 1102 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1103 1103 1104 1104 if (!bt->tx) { ··· 1113 1113 static int btcvsd_tx_mute_set(struct snd_kcontrol *kcontrol, 1114 1114 struct snd_ctl_elem_value *ucontrol) 1115 1115 { 1116 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1116 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1117 1117 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1118 1118 1119 1119 if (!bt->tx) ··· 1126 1126 static int btcvsd_rx_irq_received_get(struct snd_kcontrol *kcontrol, 1127 1127 struct snd_ctl_elem_value *ucontrol) 1128 1128 { 1129 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1129 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1130 1130 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1131 1131 1132 1132 if (!bt->rx) ··· 1139 1139 static int btcvsd_rx_timeout_get(struct snd_kcontrol *kcontrol, 1140 1140 struct snd_ctl_elem_value *ucontrol) 1141 1141 { 1142 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1142 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1143 1143 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1144 1144 1145 1145 if (!bt->rx) ··· 1153 1153 static int btcvsd_rx_timestamp_get(struct snd_kcontrol *kcontrol, 1154 1154 unsigned int __user *data, unsigned int size) 1155 1155 { 1156 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1156 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1157 1157 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1158 1158 int ret = 0; 1159 1159 struct mtk_btcvsd_snd_time_buffer_info time_buffer_info_rx; ··· 1180 1180 static int btcvsd_tx_irq_received_get(struct snd_kcontrol *kcontrol, 1181 1181 struct snd_ctl_elem_value *ucontrol) 1182 1182 { 1183 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1183 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1184 1184 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1185 1185 1186 1186 if (!bt->tx) ··· 1193 1193 static int btcvsd_tx_timeout_get(struct snd_kcontrol *kcontrol, 1194 1194 struct snd_ctl_elem_value *ucontrol) 1195 1195 { 1196 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1196 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1197 1197 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1198 1198 1199 1199 ucontrol->value.integer.value[0] = bt->tx->timeout; ··· 1203 1203 static int btcvsd_tx_timestamp_get(struct snd_kcontrol *kcontrol, 1204 1204 unsigned int __user *data, unsigned int size) 1205 1205 { 1206 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 1206 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 1207 1207 struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(cmpnt); 1208 1208 int ret = 0; 1209 1209 struct mtk_btcvsd_snd_time_buffer_info time_buffer_info_tx;