ASoC: cs42l51: Replace w->codec snd_soc_dapm_to_codec(w->dapm)
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 20 Nov 2014 20:05:38 +0000 (21:05 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 21 Nov 2014 18:20:28 +0000 (18:20 +0000)
The codec field of the snd_soc_widget struct is eventually going to be
removed, use snd_soc_dapm_to_codec(w->dapm) instead.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l51.c

index 09488d97de60d040bbdb37edfa3a94a999930633..3142bafc926299e690d59d78ca9f724728dd4aa9 100644 (file)
@@ -153,15 +153,17 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = {
 static int cs42l51_pdn_event(struct snd_soc_dapm_widget *w,
                struct snd_kcontrol *kcontrol, int event)
 {
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+
        switch (event) {
        case SND_SOC_DAPM_PRE_PMD:
-               snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1,
+               snd_soc_update_bits(codec, CS42L51_POWER_CTL1,
                                    CS42L51_POWER_CTL1_PDN,
                                    CS42L51_POWER_CTL1_PDN);
                break;
        default:
        case SND_SOC_DAPM_POST_PMD:
-               snd_soc_update_bits(w->codec, CS42L51_POWER_CTL1,
+               snd_soc_update_bits(codec, CS42L51_POWER_CTL1,
                                    CS42L51_POWER_CTL1_PDN, 0);
                break;
        }