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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
800c6664 c4ec2c9d

+3 -3
+3 -3
sound/soc/codecs/peb2466.c
··· 276 276 { 277 277 struct peb2466_lkup_ctrl *lkup_ctrl = 278 278 (struct peb2466_lkup_ctrl *)kcontrol->private_value; 279 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 279 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 280 280 struct peb2466 *peb2466 = snd_soc_component_get_drvdata(component); 281 281 unsigned int index; 282 282 int ret; ··· 377 377 static int peb2466_tg_freq_get(struct snd_kcontrol *kcontrol, 378 378 struct snd_ctl_elem_value *ucontrol) 379 379 { 380 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 380 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 381 381 struct peb2466 *peb2466 = snd_soc_component_get_drvdata(component); 382 382 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 383 383 ··· 415 415 static int peb2466_tg_freq_put(struct snd_kcontrol *kcontrol, 416 416 struct snd_ctl_elem_value *ucontrol) 417 417 { 418 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 418 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 419 419 struct peb2466 *peb2466 = snd_soc_component_get_drvdata(component); 420 420 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 421 421 unsigned int *tg_freq_item;