From c34209ba43623c2ea2593ee332f4e4f6b47fb921 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 14 Oct 2025 04:22:26 +0000 Subject: [PATCH] ASoC: codecs: max98088: 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 Link: https://patch.msgid.link/87zf9uqfi7.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/codecs/max98088.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 37e61d8d4be6c..f1cff60abce0f 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -380,7 +380,7 @@ static SOC_ENUM_SINGLE_DECL(max98088_dai1_adc_filter_enum, static int max98088_mic1pre_set(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 max98088_priv *max98088 = snd_soc_component_get_drvdata(component); unsigned int sel = ucontrol->value.integer.value[0]; @@ -394,7 +394,7 @@ static int max98088_mic1pre_set(struct snd_kcontrol *kcontrol, static int max98088_mic1pre_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 max98088_priv *max98088 = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = max98088->mic1pre; @@ -404,7 +404,7 @@ static int max98088_mic1pre_get(struct snd_kcontrol *kcontrol, static int max98088_mic2pre_set(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 max98088_priv *max98088 = snd_soc_component_get_drvdata(component); unsigned int sel = ucontrol->value.integer.value[0]; @@ -418,7 +418,7 @@ static int max98088_mic2pre_set(struct snd_kcontrol *kcontrol, static int max98088_mic2pre_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 max98088_priv *max98088 = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = max98088->mic2pre; @@ -1500,7 +1500,7 @@ static void max98088_setup_eq2(struct snd_soc_component *component) static int max98088_put_eq_enum(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 max98088_priv *max98088 = snd_soc_component_get_drvdata(component); struct max98088_pdata *pdata = max98088->pdata; int channel = max98088_get_channel(component, kcontrol->id.name); @@ -1532,7 +1532,7 @@ static int max98088_put_eq_enum(struct snd_kcontrol *kcontrol, static int max98088_get_eq_enum(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 max98088_priv *max98088 = snd_soc_component_get_drvdata(component); int channel = max98088_get_channel(component, kcontrol->id.name); struct max98088_cdata *cdata; -- 2.47.3