summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8903.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-07-29 17:13:57 +0200
committerMark Brown <broonie@linaro.org>2013-07-29 18:40:59 +0100
commiteee5d7f99ae95059e1a3d1cfa2dea3ed8dbd94ac (patch)
tree438cc363a91ee9ddb6ca0584f30e80e476323ac3 /sound/soc/codecs/wm8903.c
parent95dd5cd6e16d86786f7dc9da404ae477403d8f83 (diff)
downloadblackbird-op-linux-eee5d7f99ae95059e1a3d1cfa2dea3ed8dbd94ac.tar.gz
blackbird-op-linux-eee5d7f99ae95059e1a3d1cfa2dea3ed8dbd94ac.zip
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/wm8903.c')
-rw-r--r--sound/soc/codecs/wm8903.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index fa24cedee687..eebcb1da3b7b 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -364,9 +364,7 @@ static void wm8903_seq_notifier(struct snd_soc_dapm_context *dapm,
static int wm8903_class_w_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- struct snd_soc_dapm_widget_list *wlist = snd_kcontrol_chip(kcontrol);
- struct snd_soc_dapm_widget *widget = wlist->widgets[0];
- struct snd_soc_codec *codec = widget->codec;
+ struct snd_soc_codec *codec = snd_soc_dapm_kcontrol_codec(kcontrol);
struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
u16 reg;
int ret;
OpenPOWER on IntegriCloud