]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: wm_adsp: use snd_kcontrol_chip() instead of snd_soc_kcontrol_component()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 14 Oct 2025 04:26:58 +0000 (04:26 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 20 Oct 2025 01:44:13 +0000 (02:44 +0100)
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/871pn6nm5p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm_adsp.c

index 8782c331e9252960eab1bc91dbceacb0788caabc..b1b1459073af9992868f31091ec4caccac8237d9 100644 (file)
@@ -319,7 +319,7 @@ struct wm_coeff_ctl {
 int wm_adsp_fw_get(struct snd_kcontrol *kcontrol,
                   struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
+       struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
        struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
        struct wm_adsp *dsp = snd_soc_component_get_drvdata(component);
 
@@ -332,7 +332,7 @@ EXPORT_SYMBOL_GPL(wm_adsp_fw_get);
 int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
                   struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
+       struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
        struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
        struct wm_adsp *dsp = snd_soc_component_get_drvdata(component);
        int ret = 1;
@@ -936,7 +936,7 @@ EXPORT_SYMBOL_GPL(wm_adsp2_set_dspclk);
 int wm_adsp2_preloader_get(struct snd_kcontrol *kcontrol,
                           struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
+       struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
        struct wm_adsp *dsps = snd_soc_component_get_drvdata(component);
        struct soc_mixer_control *mc =
                (struct soc_mixer_control *)kcontrol->private_value;
@@ -951,7 +951,7 @@ EXPORT_SYMBOL_GPL(wm_adsp2_preloader_get);
 int wm_adsp2_preloader_put(struct snd_kcontrol *kcontrol,
                           struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
+       struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
        struct wm_adsp *dsps = snd_soc_component_get_drvdata(component);
        struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
        struct soc_mixer_control *mc =