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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
e6211161 ccbfc923

+2 -2
+2 -2
sound/soc/codecs/cs42l51.c
··· 57 57 static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol, 58 58 struct snd_ctl_elem_value *ucontrol) 59 59 { 60 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 60 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 61 61 unsigned long value = snd_soc_component_read(component, CS42L51_PCM_MIXER)&3; 62 62 63 63 switch (value) { ··· 85 85 static int cs42l51_set_chan_mix(struct snd_kcontrol *kcontrol, 86 86 struct snd_ctl_elem_value *ucontrol) 87 87 { 88 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 88 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 89 89 unsigned char val; 90 90 91 91 switch (ucontrol->value.enumerated.item[0]) {