]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: intel: atom: use snd_kcontrol_chip() instead of snd_soc_kcontrol_component()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 14 Oct 2025 04:27:22 +0000 (04:27 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 20 Oct 2025 01:44:19 +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/87sefmm7kl.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/atom/sst-atom-controls.c

index 38116c75871742841090649e7e17034e293ec97f..c68965f152e8a58fc73dda159a09222224a7b687 100644 (file)
@@ -218,7 +218,7 @@ static int sst_check_and_send_slot_map(struct sst_data *drv, struct snd_kcontrol
 static int sst_slot_put(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol);
+       struct snd_soc_component *c = snd_kcontrol_chip(kcontrol);
        struct sst_data *drv = snd_soc_component_get_drvdata(c);
        struct sst_enum *e = (void *)kcontrol->private_value;
        int i, ret = 0;
@@ -349,7 +349,7 @@ static int sst_algo_control_set(struct snd_kcontrol *kcontrol,
                                struct snd_ctl_elem_value *ucontrol)
 {
        int ret = 0;
-       struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+       struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
        struct sst_data *drv = snd_soc_component_get_drvdata(cmpnt);
        struct sst_algo_control *bc = (void *)kcontrol->private_value;
 
@@ -470,7 +470,7 @@ static int sst_gain_put(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_value *ucontrol)
 {
        int ret = 0;
-       struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol);
+       struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
        struct sst_data *drv = snd_soc_component_get_drvdata(cmpnt);
        struct sst_gain_mixer_control *mc = (void *)kcontrol->private_value;
        struct sst_gain_value *gv = mc->gain_val;