ASoC: wm2000: Get the CODEC pointer from the widget
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 26 Nov 2012 14:18:36 +0000 (14:18 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 27 Nov 2012 10:46:13 +0000 (10:46 +0000)
Don't rely on the kcontrol for robustness reasons, the widget mechanism
is what the framework uses.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm2000.c

index 683dc43b1d87898508b011e7ca4aee7087049f7e..02750ab020de2ff8809507f66a8ae174406fb47b 100644 (file)
@@ -646,7 +646,7 @@ static const struct snd_kcontrol_new wm2000_controls[] = {
 static int wm2000_anc_power_event(struct snd_soc_dapm_widget *w,
                                  struct snd_kcontrol *kcontrol, int event)
 {
-       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct snd_soc_codec *codec = w->codec;
        struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
 
        if (SND_SOC_DAPM_EVENT_ON(event))