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

ASoC: codecs: wm8958: 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/87frbmnm6n.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
8b412d32 1a1a66c2

+16 -16
+16 -16
sound/soc/codecs/wm8958-dsp2.c
··· 453 453 static int wm8958_put_mbc_enum(struct snd_kcontrol *kcontrol, 454 454 struct snd_ctl_elem_value *ucontrol) 455 455 { 456 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 456 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 457 457 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 458 458 struct wm8994 *control = wm8994->wm8994; 459 459 int value = ucontrol->value.enumerated.item[0]; ··· 475 475 static int wm8958_get_mbc_enum(struct snd_kcontrol *kcontrol, 476 476 struct snd_ctl_elem_value *ucontrol) 477 477 { 478 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 478 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 479 479 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 480 480 481 481 ucontrol->value.enumerated.item[0] = wm8994->mbc_cfg; ··· 497 497 struct snd_ctl_elem_value *ucontrol) 498 498 { 499 499 int mbc = kcontrol->private_value; 500 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 500 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 501 501 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 502 502 503 503 ucontrol->value.integer.value[0] = wm8994->mbc_ena[mbc]; ··· 509 509 struct snd_ctl_elem_value *ucontrol) 510 510 { 511 511 int mbc = kcontrol->private_value; 512 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 512 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 513 513 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 514 514 515 515 if (wm8994->mbc_ena[mbc] == ucontrol->value.integer.value[0]) ··· 543 543 static int wm8958_put_vss_enum(struct snd_kcontrol *kcontrol, 544 544 struct snd_ctl_elem_value *ucontrol) 545 545 { 546 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 546 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 547 547 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 548 548 struct wm8994 *control = wm8994->wm8994; 549 549 int value = ucontrol->value.enumerated.item[0]; ··· 565 565 static int wm8958_get_vss_enum(struct snd_kcontrol *kcontrol, 566 566 struct snd_ctl_elem_value *ucontrol) 567 567 { 568 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 568 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 569 569 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 570 570 571 571 ucontrol->value.enumerated.item[0] = wm8994->vss_cfg; ··· 576 576 static int wm8958_put_vss_hpf_enum(struct snd_kcontrol *kcontrol, 577 577 struct snd_ctl_elem_value *ucontrol) 578 578 { 579 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 579 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 580 580 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 581 581 struct wm8994 *control = wm8994->wm8994; 582 582 int value = ucontrol->value.enumerated.item[0]; ··· 598 598 static int wm8958_get_vss_hpf_enum(struct snd_kcontrol *kcontrol, 599 599 struct snd_ctl_elem_value *ucontrol) 600 600 { 601 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 601 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 602 602 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 603 603 604 604 ucontrol->value.enumerated.item[0] = wm8994->vss_hpf_cfg; ··· 620 620 struct snd_ctl_elem_value *ucontrol) 621 621 { 622 622 int vss = kcontrol->private_value; 623 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 623 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 624 624 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 625 625 626 626 ucontrol->value.integer.value[0] = wm8994->vss_ena[vss]; ··· 632 632 struct snd_ctl_elem_value *ucontrol) 633 633 { 634 634 int vss = kcontrol->private_value; 635 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 635 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 636 636 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 637 637 638 638 if (wm8994->vss_ena[vss] == ucontrol->value.integer.value[0]) ··· 681 681 struct snd_ctl_elem_value *ucontrol) 682 682 { 683 683 int hpf = kcontrol->private_value; 684 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 684 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 685 685 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 686 686 687 687 if (hpf < 3) ··· 696 696 struct snd_ctl_elem_value *ucontrol) 697 697 { 698 698 int hpf = kcontrol->private_value; 699 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 699 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 700 700 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 701 701 702 702 if (hpf < 3) { ··· 743 743 static int wm8958_put_enh_eq_enum(struct snd_kcontrol *kcontrol, 744 744 struct snd_ctl_elem_value *ucontrol) 745 745 { 746 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 746 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 747 747 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 748 748 struct wm8994 *control = wm8994->wm8994; 749 749 int value = ucontrol->value.enumerated.item[0]; ··· 765 765 static int wm8958_get_enh_eq_enum(struct snd_kcontrol *kcontrol, 766 766 struct snd_ctl_elem_value *ucontrol) 767 767 { 768 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 768 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 769 769 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 770 770 771 771 ucontrol->value.enumerated.item[0] = wm8994->enh_eq_cfg; ··· 787 787 struct snd_ctl_elem_value *ucontrol) 788 788 { 789 789 int eq = kcontrol->private_value; 790 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 790 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 791 791 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 792 792 793 793 ucontrol->value.integer.value[0] = wm8994->enh_eq_ena[eq]; ··· 799 799 struct snd_ctl_elem_value *ucontrol) 800 800 { 801 801 int eq = kcontrol->private_value; 802 - struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); 802 + struct snd_soc_component *component = snd_kcontrol_chip(kcontrol); 803 803 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); 804 804 805 805 if (wm8994->enh_eq_ena[eq] == ucontrol->value.integer.value[0])