From: Kuninori Morimoto Date: Tue, 14 Oct 2025 04:26:31 +0000 (+0000) Subject: ASoC: codecs: wm8962: use snd_kcontrol_chip() instead of snd_soc_kcontrol_component() X-Git-Tag: v6.19-rc1~156^2~3^2~97^2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3314ee8db5411e1f9adc0172ebe425c8a8066cab;p=thirdparty%2Fkernel%2Flinux.git ASoC: codecs: wm8962: 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/87cy6qnm6g.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 08c8ec3aeb449..a5ad916966b27 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -1545,7 +1545,7 @@ static int wm8962_dsp2_ena_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int shift = kcontrol->private_value; - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); ucontrol->value.integer.value[0] = !!(wm8962->dsp2_ena & 1 << shift); @@ -1557,7 +1557,7 @@ static int wm8962_dsp2_ena_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { int shift = kcontrol->private_value; - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component); int old = wm8962->dsp2_ena; int ret = 0; @@ -1595,7 +1595,7 @@ out: static int wm8962_put_hp_sw(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); int ret; /* Apply the update (if any) */ @@ -1625,7 +1625,7 @@ static int wm8962_put_hp_sw(struct snd_kcontrol *kcontrol, static int wm8962_put_spk_sw(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); int ret; /* Apply the update (if any) */