OSDN Git Service

ASoC: tlv320aic31xx: Replace w->codec snd_soc_dapm_to_codec(w->dapm)
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 15 Jan 2015 11:52:03 +0000 (12:52 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 15 Jan 2015 11:57:05 +0000 (11:57 +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>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tlv320aic31xx.c

index dc3223d..c86dd9a 100644 (file)
@@ -349,7 +349,8 @@ static int aic31xx_wait_bits(struct aic31xx_priv *aic31xx, unsigned int reg,
 static int aic31xx_dapm_power_event(struct snd_soc_dapm_widget *w,
                                    struct snd_kcontrol *kcontrol, int event)
 {
-       struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(w->codec);
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
+       struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
        unsigned int reg = AIC31XX_DACFLAG1;
        unsigned int mask;
 
@@ -377,7 +378,7 @@ static int aic31xx_dapm_power_event(struct snd_soc_dapm_widget *w,
                reg = AIC31XX_ADCFLAG;
                break;
        default:
-               dev_err(w->codec->dev, "Unknown widget '%s' calling %s\n",
+               dev_err(codec->dev, "Unknown widget '%s' calling %s\n",
                        w->name, __func__);
                return -EINVAL;
        }
@@ -388,7 +389,7 @@ static int aic31xx_dapm_power_event(struct snd_soc_dapm_widget *w,
        case SND_SOC_DAPM_POST_PMD:
                return aic31xx_wait_bits(aic31xx, reg, mask, 0, 5000, 100);
        default:
-               dev_dbg(w->codec->dev,
+               dev_dbg(codec->dev,
                        "Unhandled dapm widget event %d from %s\n",
                        event, w->name);
        }
@@ -433,7 +434,7 @@ static const struct snd_kcontrol_new aic31xx_dapm_spr_switch =
 static int mic_bias_event(struct snd_soc_dapm_widget *w,
                          struct snd_kcontrol *kcontrol, int event)
 {
-       struct snd_soc_codec *codec = w->codec;
+       struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
        struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
 
        switch (event) {