ASoC: spear: spdif_out: Fix mute control
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 3 Mar 2014 07:57:49 +0000 (08:57 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 10 Mar 2014 17:43:15 +0000 (17:43 +0000)
For controls registers with snd_soc_add_dai_controls snd_kcontrol_chip() returns
a pointer to the DAI, not to the CODEC.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/spear/spdif_out.c

index fe99f461aff0bfd97337f663ba2f13eecd626bbb..19cca043e6e46ffa60a31514eaa778f0a4ca46d5 100644 (file)
@@ -213,10 +213,7 @@ static int spdif_digital_mute(struct snd_soc_dai *dai, int mute)
 static int spdif_mute_get(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-       struct snd_soc_card *card = codec->card;
-       struct snd_soc_pcm_runtime *rtd = card->rtd;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kcontrol);
        struct spdif_out_dev *host = snd_soc_dai_get_drvdata(cpu_dai);
 
        ucontrol->value.integer.value[0] = host->saved_params.mute;
@@ -226,10 +223,7 @@ static int spdif_mute_get(struct snd_kcontrol *kcontrol,
 static int spdif_mute_put(struct snd_kcontrol *kcontrol,
                struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-       struct snd_soc_card *card = codec->card;
-       struct snd_soc_pcm_runtime *rtd = card->rtd;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
+       struct snd_soc_dai *cpu_dai = snd_kcontrol_chip(kcontrol);
        struct spdif_out_dev *host = snd_soc_dai_get_drvdata(cpu_dai);
 
        if (host->saved_params.mute == ucontrol->value.integer.value[0])