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

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

authored by

Kuninori Morimoto and committed by
Mark Brown
40c729f0 a43676fa

+16 -16
+16 -16
sound/soc/codecs/aw88399.c
··· 1744 1744 static int aw88399_get_fade_in_time(struct snd_kcontrol *kcontrol, 1745 1745 struct snd_ctl_elem_value *ucontrol) 1746 1746 { 1747 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1747 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1748 1748 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(component); 1749 1749 struct aw_device *aw_dev = aw88399->aw_pa; 1750 1750 ··· 1756 1756 static int aw88399_set_fade_in_time(struct snd_kcontrol *kcontrol, 1757 1757 struct snd_ctl_elem_value *ucontrol) 1758 1758 { 1759 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1759 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1760 1760 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(component); 1761 1761 struct soc_mixer_control *mc = 1762 1762 (struct soc_mixer_control *)kcontrol->private_value; ··· 1779 1779 static int aw88399_get_fade_out_time(struct snd_kcontrol *kcontrol, 1780 1780 struct snd_ctl_elem_value *ucontrol) 1781 1781 { 1782 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1782 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1783 1783 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(component); 1784 1784 struct aw_device *aw_dev = aw88399->aw_pa; 1785 1785 ··· 1791 1791 static int aw88399_set_fade_out_time(struct snd_kcontrol *kcontrol, 1792 1792 struct snd_ctl_elem_value *ucontrol) 1793 1793 { 1794 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 1794 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 1795 1795 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(component); 1796 1796 struct soc_mixer_control *mc = 1797 1797 (struct soc_mixer_control *)kcontrol->private_value; ··· 1829 1829 static int aw88399_profile_info(struct snd_kcontrol *kcontrol, 1830 1830 struct snd_ctl_elem_info *uinfo) 1831 1831 { 1832 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1832 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1833 1833 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1834 1834 char *prof_name; 1835 1835 int count, ret; ··· 1864 1864 static int aw88399_profile_get(struct snd_kcontrol *kcontrol, 1865 1865 struct snd_ctl_elem_value *ucontrol) 1866 1866 { 1867 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1867 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1868 1868 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1869 1869 1870 1870 ucontrol->value.integer.value[0] = aw88399->aw_pa->prof_index; ··· 1875 1875 static int aw88399_profile_set(struct snd_kcontrol *kcontrol, 1876 1876 struct snd_ctl_elem_value *ucontrol) 1877 1877 { 1878 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1878 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1879 1879 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1880 1880 int ret; 1881 1881 ··· 1900 1900 static int aw88399_volume_get(struct snd_kcontrol *kcontrol, 1901 1901 struct snd_ctl_elem_value *ucontrol) 1902 1902 { 1903 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1903 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1904 1904 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1905 1905 struct aw_volume_desc *vol_desc = &aw88399->aw_pa->volume_desc; 1906 1906 ··· 1912 1912 static int aw88399_volume_set(struct snd_kcontrol *kcontrol, 1913 1913 struct snd_ctl_elem_value *ucontrol) 1914 1914 { 1915 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1915 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1916 1916 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1917 1917 struct aw_volume_desc *vol_desc = &aw88399->aw_pa->volume_desc; 1918 1918 struct soc_mixer_control *mc = ··· 1936 1936 static int aw88399_get_fade_step(struct snd_kcontrol *kcontrol, 1937 1937 struct snd_ctl_elem_value *ucontrol) 1938 1938 { 1939 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1939 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1940 1940 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1941 1941 1942 1942 ucontrol->value.integer.value[0] = aw88399->aw_pa->fade_step; ··· 1947 1947 static int aw88399_set_fade_step(struct snd_kcontrol *kcontrol, 1948 1948 struct snd_ctl_elem_value *ucontrol) 1949 1949 { 1950 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1950 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1951 1951 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1952 1952 struct soc_mixer_control *mc = 1953 1953 (struct soc_mixer_control *)kcontrol->private_value; ··· 1968 1968 static int aw88399_re_get(struct snd_kcontrol *kcontrol, 1969 1969 struct snd_ctl_elem_value *ucontrol) 1970 1970 { 1971 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1971 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1972 1972 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1973 1973 struct aw_device *aw_dev = aw88399->aw_pa; 1974 1974 ··· 1980 1980 static int aw88399_re_set(struct snd_kcontrol *kcontrol, 1981 1981 struct snd_ctl_elem_value *ucontrol) 1982 1982 { 1983 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 1983 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 1984 1984 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 1985 1985 struct soc_mixer_control *mc = 1986 1986 (struct soc_mixer_control *)kcontrol->private_value; ··· 2002 2002 static int aw88399_calib_switch_get(struct snd_kcontrol *kcontrol, 2003 2003 struct snd_ctl_elem_value *ucontrol) 2004 2004 { 2005 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 2005 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 2006 2006 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 2007 2007 struct aw_device *aw_dev = aw88399->aw_pa; 2008 2008 ··· 2014 2014 static int aw88399_calib_switch_set(struct snd_kcontrol *kcontrol, 2015 2015 struct snd_ctl_elem_value *ucontrol) 2016 2016 { 2017 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 2017 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 2018 2018 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 2019 2019 struct aw_device *aw_dev = aw88399->aw_pa; 2020 2020 ··· 2036 2036 static int aw88399_calib_set(struct snd_kcontrol *kcontrol, 2037 2037 struct snd_ctl_elem_value *ucontrol) 2038 2038 { 2039 - struct snd_soc_component *codec = snd_soc_kcontrol_component(kcontrol); 2039 + struct snd_soc_component *codec = snd_kcontrol_chip(kcontrol); 2040 2040 struct aw88399 *aw88399 = snd_soc_component_get_drvdata(codec); 2041 2041 struct aw_device *aw_dev = aw88399->aw_pa; 2042 2042