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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
a7aa3443 5ab215f2

+4 -4
+4 -4
sound/soc/codecs/sgtl5000.c
··· 540 540 static int dac_get_volsw(struct snd_kcontrol *kcontrol, 541 541 struct snd_ctl_elem_value *ucontrol) 542 542 { 543 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 543 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 544 544 int reg; 545 545 int l; 546 546 int r; ··· 593 593 static int dac_put_volsw(struct snd_kcontrol *kcontrol, 594 594 struct snd_ctl_elem_value *ucontrol) 595 595 { 596 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 596 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 597 597 int reg; 598 598 int l; 599 599 int r; ··· 631 631 static int avc_get_threshold(struct snd_kcontrol *kcontrol, 632 632 struct snd_ctl_elem_value *ucontrol) 633 633 { 634 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 634 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 635 635 int db, i; 636 636 u16 reg = snd_soc_component_read(component, SGTL5000_DAP_AVC_THRESHOLD); 637 637 ··· 664 664 static int avc_put_threshold(struct snd_kcontrol *kcontrol, 665 665 struct snd_ctl_elem_value *ucontrol) 666 666 { 667 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 667 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 668 668 int db; 669 669 u16 reg; 670 670