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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
ca6731ad 601e7b30

+4 -4
+4 -4
sound/soc/rockchip/rockchip_sai.c
··· 1227 1227 static int rockchip_sai_rd_wait_time_get(struct snd_kcontrol *kcontrol, 1228 1228 struct snd_ctl_elem_value *ucontrol) 1229 1229 { 1230 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1230 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1231 1231 struct rk_sai_dev *sai = snd_soc_component_get_drvdata(component); 1232 1232 1233 1233 ucontrol->value.integer.value[0] = sai->wait_time[SNDRV_PCM_STREAM_CAPTURE]; ··· 1238 1238 static int rockchip_sai_rd_wait_time_put(struct snd_kcontrol *kcontrol, 1239 1239 struct snd_ctl_elem_value *ucontrol) 1240 1240 { 1241 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1241 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1242 1242 struct rk_sai_dev *sai = snd_soc_component_get_drvdata(component); 1243 1243 1244 1244 if (ucontrol->value.integer.value[0] > WAIT_TIME_MS_MAX) ··· 1252 1252 static int rockchip_sai_wr_wait_time_get(struct snd_kcontrol *kcontrol, 1253 1253 struct snd_ctl_elem_value *ucontrol) 1254 1254 { 1255 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1255 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1256 1256 struct rk_sai_dev *sai = snd_soc_component_get_drvdata(component); 1257 1257 1258 1258 ucontrol->value.integer.value[0] = sai->wait_time[SNDRV_PCM_STREAM_PLAYBACK]; ··· 1263 1263 static int rockchip_sai_wr_wait_time_put(struct snd_kcontrol *kcontrol, 1264 1264 struct snd_ctl_elem_value *ucontrol) 1265 1265 { 1266 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1266 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1267 1267 struct rk_sai_dev *sai = snd_soc_component_get_drvdata(component); 1268 1268 1269 1269 if (ucontrol->value.integer.value[0] > WAIT_TIME_MS_MAX)