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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
7e4cdef1 308eee44

+8 -8
+2 -2
sound/soc/uniphier/aio-cpu.c
··· 623 623 static int uniphier_aio_vol_get(struct snd_kcontrol *kcontrol, 624 624 struct snd_ctl_elem_value *ucontrol) 625 625 { 626 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 626 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 627 627 struct uniphier_aio_chip *chip = snd_soc_component_get_drvdata(comp); 628 628 struct uniphier_aio_sub *sub; 629 629 int oport_hw = kcontrol->private_value; ··· 640 640 static int uniphier_aio_vol_put(struct snd_kcontrol *kcontrol, 641 641 struct snd_ctl_elem_value *ucontrol) 642 642 { 643 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 643 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 644 644 struct uniphier_aio_chip *chip = snd_soc_component_get_drvdata(comp); 645 645 struct uniphier_aio_sub *sub; 646 646 int oport_hw = kcontrol->private_value;
+6 -6
sound/soc/uniphier/evea.c
··· 228 228 static int evea_get_switch_lin(struct snd_kcontrol *kcontrol, 229 229 struct snd_ctl_elem_value *ucontrol) 230 230 { 231 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 231 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 232 232 struct evea_priv *evea = snd_soc_component_get_drvdata(component); 233 233 234 234 ucontrol->value.integer.value[0] = evea->switch_lin; ··· 239 239 static int evea_set_switch_lin(struct snd_kcontrol *kcontrol, 240 240 struct snd_ctl_elem_value *ucontrol) 241 241 { 242 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 242 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 243 243 struct evea_priv *evea = snd_soc_component_get_drvdata(component); 244 244 245 245 if (evea->switch_lin == ucontrol->value.integer.value[0]) ··· 253 253 static int evea_get_switch_lo(struct snd_kcontrol *kcontrol, 254 254 struct snd_ctl_elem_value *ucontrol) 255 255 { 256 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 256 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 257 257 struct evea_priv *evea = snd_soc_component_get_drvdata(component); 258 258 259 259 ucontrol->value.integer.value[0] = evea->switch_lo; ··· 264 264 static int evea_set_switch_lo(struct snd_kcontrol *kcontrol, 265 265 struct snd_ctl_elem_value *ucontrol) 266 266 { 267 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 267 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 268 268 struct evea_priv *evea = snd_soc_component_get_drvdata(component); 269 269 270 270 if (evea->switch_lo == ucontrol->value.integer.value[0]) ··· 278 278 static int evea_get_switch_hp(struct snd_kcontrol *kcontrol, 279 279 struct snd_ctl_elem_value *ucontrol) 280 280 { 281 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 281 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 282 282 struct evea_priv *evea = snd_soc_component_get_drvdata(component); 283 283 284 284 ucontrol->value.integer.value[0] = evea->switch_hp; ··· 289 289 static int evea_set_switch_hp(struct snd_kcontrol *kcontrol, 290 290 struct snd_ctl_elem_value *ucontrol) 291 291 { 292 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 292 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 293 293 struct evea_priv *evea = snd_soc_component_get_drvdata(component); 294 294 295 295 if (evea->switch_hp == ucontrol->value.integer.value[0])