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

ASoC: codecs: rt1015: 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/878qheqfg3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
b805b4e0 6950709b

+4 -8
+4 -8
sound/soc/codecs/rt1015.c
··· 427 427 static int rt1015_boost_mode_get(struct snd_kcontrol *kcontrol, 428 428 struct snd_ctl_elem_value *ucontrol) 429 429 { 430 - struct snd_soc_component *component = 431 - snd_soc_kcontrol_component(kcontrol); 430 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 432 431 struct rt1015_priv *rt1015 = 433 432 snd_soc_component_get_drvdata(component); 434 433 ··· 439 440 static int rt1015_boost_mode_put(struct snd_kcontrol *kcontrol, 440 441 struct snd_ctl_elem_value *ucontrol) 441 442 { 442 - struct snd_soc_component *component = 443 - snd_soc_kcontrol_component(kcontrol); 443 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 444 444 struct rt1015_priv *rt1015 = 445 445 snd_soc_component_get_drvdata(component); 446 446 int boost_mode = ucontrol->value.integer.value[0]; ··· 479 481 static int rt1015_bypass_boost_get(struct snd_kcontrol *kcontrol, 480 482 struct snd_ctl_elem_value *ucontrol) 481 483 { 482 - struct snd_soc_component *component = 483 - snd_soc_kcontrol_component(kcontrol); 484 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 484 485 struct rt1015_priv *rt1015 = 485 486 snd_soc_component_get_drvdata(component); 486 487 ··· 521 524 static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol, 522 525 struct snd_ctl_elem_value *ucontrol) 523 526 { 524 - struct snd_soc_component *component = 525 - snd_soc_kcontrol_component(kcontrol); 527 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 526 528 struct rt1015_priv *rt1015 = 527 529 snd_soc_component_get_drvdata(component); 528 530