Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: wm8904: 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 <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ikginm6u.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
161e3c82 18096d76

+7 -7
+7 -7
sound/soc/codecs/wm8904.c
··· 388 388 static int wm8904_put_drc_enum(struct snd_kcontrol *kcontrol, 389 389 struct snd_ctl_elem_value *ucontrol) 390 390 { 391 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 391 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 392 392 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 393 393 struct wm8904_pdata *pdata = wm8904->pdata; 394 394 int value = ucontrol->value.enumerated.item[0]; ··· 406 406 static int wm8904_get_drc_enum(struct snd_kcontrol *kcontrol, 407 407 struct snd_ctl_elem_value *ucontrol) 408 408 { 409 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 409 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 410 410 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 411 411 412 412 ucontrol->value.enumerated.item[0] = wm8904->drc_cfg; ··· 459 459 static int wm8904_put_retune_mobile_enum(struct snd_kcontrol *kcontrol, 460 460 struct snd_ctl_elem_value *ucontrol) 461 461 { 462 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 462 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 463 463 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 464 464 struct wm8904_pdata *pdata = wm8904->pdata; 465 465 int value = ucontrol->value.enumerated.item[0]; ··· 477 477 static int wm8904_get_retune_mobile_enum(struct snd_kcontrol *kcontrol, 478 478 struct snd_ctl_elem_value *ucontrol) 479 479 { 480 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 480 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 481 481 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 482 482 483 483 ucontrol->value.enumerated.item[0] = wm8904->retune_mobile_cfg; ··· 517 517 static int wm8904_get_deemph(struct snd_kcontrol *kcontrol, 518 518 struct snd_ctl_elem_value *ucontrol) 519 519 { 520 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 520 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 521 521 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 522 522 523 523 ucontrol->value.integer.value[0] = wm8904->deemph; ··· 527 527 static int wm8904_put_deemph(struct snd_kcontrol *kcontrol, 528 528 struct snd_ctl_elem_value *ucontrol) 529 529 { 530 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 530 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 531 531 struct wm8904_priv *wm8904 = snd_soc_component_get_drvdata(component); 532 532 unsigned int deemph = ucontrol->value.integer.value[0]; 533 533 ··· 555 555 static int wm8904_adc_osr_put(struct snd_kcontrol *kcontrol, 556 556 struct snd_ctl_elem_value *ucontrol) 557 557 { 558 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 558 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 559 559 unsigned int val; 560 560 int ret; 561 561