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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
205a7f5c db25c438

+11 -11
+11 -11
sound/soc/codecs/aw88081.c
··· 808 808 static int aw88081_get_fade_in_time(struct snd_kcontrol *kcontrol, 809 809 struct snd_ctl_elem_value *ucontrol) 810 810 { 811 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 811 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 812 812 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(component); 813 813 struct aw_device *aw_dev = aw88081->aw_pa; 814 814 ··· 820 820 static int aw88081_set_fade_in_time(struct snd_kcontrol *kcontrol, 821 821 struct snd_ctl_elem_value *ucontrol) 822 822 { 823 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 823 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 824 824 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(component); 825 825 struct soc_mixer_control *mc = 826 826 (struct soc_mixer_control *)kcontrol->private_value; ··· 843 843 static int aw88081_get_fade_out_time(struct snd_kcontrol *kcontrol, 844 844 struct snd_ctl_elem_value *ucontrol) 845 845 { 846 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 846 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 847 847 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(component); 848 848 struct aw_device *aw_dev = aw88081->aw_pa; 849 849 ··· 855 855 static int aw88081_set_fade_out_time(struct snd_kcontrol *kcontrol, 856 856 struct snd_ctl_elem_value *ucontrol) 857 857 { 858 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 858 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 859 859 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(component); 860 860 struct soc_mixer_control *mc = 861 861 (struct soc_mixer_control *)kcontrol->private_value; ··· 891 891 static int aw88081_profile_info(struct snd_kcontrol *kcontrol, 892 892 struct snd_ctl_elem_info *uinfo) 893 893 { 894 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 894 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 895 895 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(codec); 896 896 char *prof_name; 897 897 int count, ret; ··· 926 926 static int aw88081_profile_get(struct snd_kcontrol *kcontrol, 927 927 struct snd_ctl_elem_value *ucontrol) 928 928 { 929 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 929 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 930 930 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(codec); 931 931 932 932 ucontrol->value.integer.value[0] = aw88081->aw_pa->prof_index; ··· 937 937 static int aw88081_profile_set(struct snd_kcontrol *kcontrol, 938 938 struct snd_ctl_elem_value *ucontrol) 939 939 { 940 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 940 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 941 941 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(codec); 942 942 int ret; 943 943 ··· 963 963 static int aw88081_volume_get(struct snd_kcontrol *kcontrol, 964 964 struct snd_ctl_elem_value *ucontrol) 965 965 { 966 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 966 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 967 967 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(codec); 968 968 struct aw_volume_desc *vol_desc = &aw88081->aw_pa->volume_desc; 969 969 ··· 975 975 static int aw88081_volume_set(struct snd_kcontrol *kcontrol, 976 976 struct snd_ctl_elem_value *ucontrol) 977 977 { 978 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 978 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 979 979 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(codec); 980 980 struct aw_volume_desc *vol_desc = &aw88081->aw_pa->volume_desc; 981 981 struct soc_mixer_control *mc = ··· 1003 1003 static int aw88081_get_fade_step(struct snd_kcontrol *kcontrol, 1004 1004 struct snd_ctl_elem_value *ucontrol) 1005 1005 { 1006 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1006 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1007 1007 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(codec); 1008 1008 1009 1009 ucontrol->value.integer.value[0] = aw88081->aw_pa->fade_step; ··· 1014 1014 static int aw88081_set_fade_step(struct snd_kcontrol *kcontrol, 1015 1015 struct snd_ctl_elem_value *ucontrol) 1016 1016 { 1017 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1017 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1018 1018 struct aw88081 *aw88081 = snd_soc_component_get_drvdata(codec); 1019 1019 struct soc_mixer_control *mc = 1020 1020 (struct soc_mixer_control *)kcontrol->private_value;