diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-07-29 11:13:57 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-29 13:40:59 -0400 |
commit | eee5d7f99ae95059e1a3d1cfa2dea3ed8dbd94ac (patch) | |
tree | 438cc363a91ee9ddb6ca0584f30e80e476323ac3 /sound/soc/codecs/wm8995.c | |
parent | 95dd5cd6e16d86786f7dc9da404ae477403d8f83 (diff) |
ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrol
We use the same 3 lines to get the CODEC for a kcontrol in a quite a few places.
This patch puts them into a common helper function. Having this encapsulated in
a helper function will also make it more easier to eventually change the data
layout of the kcontrol's private data.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/wm8995.c')
-rw-r--r-- | sound/soc/codecs/wm8995.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 90a65c427541..da2899e6c401 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c | |||
@@ -549,12 +549,9 @@ static int check_clk_sys(struct snd_soc_dapm_widget *source, | |||
549 | static int wm8995_put_class_w(struct snd_kcontrol *kcontrol, | 549 | static int wm8995_put_class_w(struct snd_kcontrol *kcontrol, |
550 | struct snd_ctl_elem_value *ucontrol) | 550 | struct snd_ctl_elem_value *ucontrol) |
551 | { | 551 | { |
552 | struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol); | 552 | struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol); |
553 | struct snd_soc_dapm_widget *w = wlist->widgets[0]; | ||
554 | struct snd_soc_codec *codec; | ||
555 | int ret; | 553 | int ret; |
556 | 554 | ||
557 | codec = w->codec; | ||
558 | ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); | 555 | ret = snd_soc_dapm_put_volsw(kcontrol, ucontrol); |
559 | wm8995_update_class_w(codec); | 556 | wm8995_update_class_w(codec); |
560 | return ret; | 557 | return ret; |