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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
1ad2f1c5 b805b4e0

+2 -2
+2 -2
sound/soc/codecs/rt1318.c
··· 505 505 static int rt1318_dvol_put(struct snd_kcontrol *kcontrol, 506 506 struct snd_ctl_elem_value *ucontrol) 507 507 { 508 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 508 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 509 509 struct rt1318_priv *rt1318 = snd_soc_component_get_drvdata(component); 510 510 511 511 rt1318->rt1318_dvol = ucontrol->value.integer.value[0]; ··· 528 528 static int rt1318_dvol_get(struct snd_kcontrol *kcontrol, 529 529 struct snd_ctl_elem_value *ucontrol) 530 530 { 531 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 531 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 532 532 struct rt1318_priv *rt1318 = snd_soc_component_get_drvdata(component); 533 533 534 534 ucontrol->value.integer.value[0] = rt1318->rt1318_dvol;