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

ASoC: mediatek: mt8183: 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/87o6qam7kb.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
b9b68f3a 96b67f92

+4 -4
+2 -2
sound/soc/mediatek/mt8183/mt8183-dai-adda.c
··· 113 113 static int mt8183_adda_dmic_get(struct snd_kcontrol *kcontrol, 114 114 struct snd_ctl_elem_value *ucontrol) 115 115 { 116 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 116 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 117 117 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); 118 118 struct mt8183_afe_private *afe_priv = afe->platform_priv; 119 119 ··· 125 125 static int mt8183_adda_dmic_set(struct snd_kcontrol *kcontrol, 126 126 struct snd_ctl_elem_value *ucontrol) 127 127 { 128 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 128 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 129 129 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); 130 130 struct mt8183_afe_private *afe_priv = afe->platform_priv; 131 131 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
+2 -2
sound/soc/mediatek/mt8183/mt8183-dai-i2s.c
··· 118 118 static int mt8183_i2s_hd_get(struct snd_kcontrol *kcontrol, 119 119 struct snd_ctl_elem_value *ucontrol) 120 120 { 121 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 121 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 122 122 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); 123 123 struct mtk_afe_i2s_priv *i2s_priv; 124 124 ··· 137 137 static int mt8183_i2s_hd_set(struct snd_kcontrol *kcontrol, 138 138 struct snd_ctl_elem_value *ucontrol) 139 139 { 140 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 140 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 141 141 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); 142 142 struct mtk_afe_i2s_priv *i2s_priv; 143 143 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;