]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: tlv320aix31xx: Replace direct snd_soc_codec dapm field access
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 15 May 2015 10:32:56 +0000 (12:32 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 15 May 2015 15:48:56 +0000 (16:48 +0100)
The dapm field of the snd_soc_codec struct is eventually going to be
removed, in preparation for this replace all manual access to
codec->dapm.bias_level with snd_soc_codec_get_bias_level() and replace all
other manual access to codec->dapm with snd_soc_codec_get_dapm().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/tlv320aic31xx.c

index e629273019d07dde5d90feefdc3e9b2663bc8518..c4c960f592a1fb092d43d1610d52316bb0422c97 100644 (file)
@@ -646,7 +646,7 @@ static int aic31xx_add_controls(struct snd_soc_codec *codec)
 
 static int aic31xx_add_widgets(struct snd_soc_codec *codec)
 {
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
        struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
        int ret = 0;
 
@@ -1027,17 +1027,17 @@ static int aic31xx_set_bias_level(struct snd_soc_codec *codec,
                                  enum snd_soc_bias_level level)
 {
        dev_dbg(codec->dev, "## %s: %d -> %d\n", __func__,
-               codec->dapm.bias_level, level);
+               snd_soc_codec_get_bias_level(codec), level);
 
        switch (level) {
        case SND_SOC_BIAS_ON:
                break;
        case SND_SOC_BIAS_PREPARE:
-               if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY)
+               if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_STANDBY)
                        aic31xx_clk_on(codec);
                break;
        case SND_SOC_BIAS_STANDBY:
-               switch (codec->dapm.bias_level) {
+               switch (snd_soc_codec_get_bias_level(codec)) {
                case SND_SOC_BIAS_OFF:
                        aic31xx_power_on(codec);
                        break;
@@ -1049,7 +1049,7 @@ static int aic31xx_set_bias_level(struct snd_soc_codec *codec,
                }
                break;
        case SND_SOC_BIAS_OFF:
-               if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY)
+               if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_STANDBY)
                        aic31xx_power_off(codec);
                break;
        }