From 7e4cdef1ef8f8a3baa6806d42f6ee2f64d75cc17 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 14 Oct 2025 04:27:59 +0000 Subject: [PATCH] ASoC: uniphier: 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/87cy6qm7jk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- sound/soc/uniphier/aio-cpu.c | 4 ++-- sound/soc/uniphier/evea.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c index 3224c11a527f..d3dba21b2d04 100644 --- a/sound/soc/uniphier/aio-cpu.c +++ b/sound/soc/uniphier/aio-cpu.c @@ -623,7 +623,7 @@ static int uniphier_aio_vol_info(struct snd_kcontrol *kcontrol, static int uniphier_aio_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); struct uniphier_aio_chip *chip = snd_soc_component_get_drvdata(comp); struct uniphier_aio_sub *sub; int oport_hw = kcontrol->private_value; @@ -640,7 +640,7 @@ static int uniphier_aio_vol_get(struct snd_kcontrol *kcontrol, static int uniphier_aio_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); struct uniphier_aio_chip *chip = snd_soc_component_get_drvdata(comp); struct uniphier_aio_sub *sub; int oport_hw = kcontrol->private_value; diff --git a/sound/soc/uniphier/evea.c b/sound/soc/uniphier/evea.c index f6c6eb95262a..7def3e7e0619 100644 --- a/sound/soc/uniphier/evea.c +++ b/sound/soc/uniphier/evea.c @@ -228,7 +228,7 @@ static void evea_update_switch_all(struct evea_priv *evea) static int evea_get_switch_lin(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 evea_priv *evea = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = evea->switch_lin; @@ -239,7 +239,7 @@ static int evea_get_switch_lin(struct snd_kcontrol *kcontrol, static int evea_set_switch_lin(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 evea_priv *evea = snd_soc_component_get_drvdata(component); if (evea->switch_lin == ucontrol->value.integer.value[0]) @@ -253,7 +253,7 @@ static int evea_set_switch_lin(struct snd_kcontrol *kcontrol, static int evea_get_switch_lo(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 evea_priv *evea = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = evea->switch_lo; @@ -264,7 +264,7 @@ static int evea_get_switch_lo(struct snd_kcontrol *kcontrol, static int evea_set_switch_lo(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 evea_priv *evea = snd_soc_component_get_drvdata(component); if (evea->switch_lo == ucontrol->value.integer.value[0]) @@ -278,7 +278,7 @@ static int evea_set_switch_lo(struct snd_kcontrol *kcontrol, static int evea_get_switch_hp(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 evea_priv *evea = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = evea->switch_hp; @@ -289,7 +289,7 @@ static int evea_get_switch_hp(struct snd_kcontrol *kcontrol, static int evea_set_switch_hp(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 evea_priv *evea = snd_soc_component_get_drvdata(component); if (evea->switch_hp == ucontrol->value.integer.value[0])