ASoC: adav80x: Replace direct snd_soc_codec dapm field access
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 4 May 2015 16:46:11 +0000 (18:46 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 4 May 2015 17:32:53 +0000 (18:32 +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().

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

index 4373ada95648e6890f013582b97c355b45e76dd1..f762247ae5a88c5692e879dd8d235c01c07f07e3 100644 (file)
@@ -539,7 +539,7 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec,
                              unsigned int freq, int dir)
 {
        struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
 
        if (dir == SND_SOC_CLOCK_IN) {
                switch (clk_id) {
@@ -622,6 +622,7 @@ static int adav80x_set_sysclk(struct snd_soc_codec *codec,
 static int adav80x_set_pll(struct snd_soc_codec *codec, int pll_id,
                int source, unsigned int freq_in, unsigned int freq_out)
 {
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
        struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
        unsigned int pll_ctrl1 = 0;
        unsigned int pll_ctrl2 = 0;
@@ -687,7 +688,7 @@ static int adav80x_set_pll(struct snd_soc_codec *codec, int pll_id,
 
                adav80x->pll_src = source;
 
-               snd_soc_dapm_sync(&codec->dapm);
+               snd_soc_dapm_sync(dapm);
        }
 
        return 0;
@@ -801,11 +802,12 @@ static struct snd_soc_dai_driver adav80x_dais[] = {
 
 static int adav80x_probe(struct snd_soc_codec *codec)
 {
+       struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec);
        struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
 
        /* Force PLLs on for SYSCLK output */
-       snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL1");
-       snd_soc_dapm_force_enable_pin(&codec->dapm, "PLL2");
+       snd_soc_dapm_force_enable_pin(dapm, "PLL1");
+       snd_soc_dapm_force_enable_pin(dapm, "PLL2");
 
        /* Power down S/PDIF receiver, since it is currently not supported */
        regmap_write(adav80x->regmap, ADAV80X_PLL_OUTE, 0x20);