diff mbox

ASoC: rt5677: fixed rt5677_dsp_vad_put rt5677_dsp_vad_get panic

Message ID 1419392945-29971-1-git-send-email-yang.a.fang@intel.com (mailing list archive)
State Accepted
Commit 6087fcab7bd5122e7264504854ec77d5be0286ff
Headers show

Commit Message

yang.a.fang@intel.com Dec. 24, 2014, 3:49 a.m. UTC
From: "Fang, Yang A" <yang.a.fang@intel.com>

snd_kcontrol_chip should return snd_soc_component instead of
snd_soc_codec

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
---
 sound/soc/codecs/rt5677.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Mark Brown Dec. 24, 2014, 11:57 a.m. UTC | #1
On Tue, Dec 23, 2014 at 11:49:05PM -0400, yang.a.fang@intel.com wrote:
> From: "Fang, Yang A" <yang.a.fang@intel.com>
> 
> snd_kcontrol_chip should return snd_soc_component instead of
> snd_soc_codec

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 81fe146..c0fbe18 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -784,8 +784,8 @@  static unsigned int bst_tlv[] = {
 static int rt5677_dsp_vad_get(struct snd_kcontrol *kcontrol,
 		struct snd_ctl_elem_value *ucontrol)
 {
-	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-	struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+	struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
 
 	ucontrol->value.integer.value[0] = rt5677->dsp_vad_en;
 
@@ -795,8 +795,9 @@  static int rt5677_dsp_vad_get(struct snd_kcontrol *kcontrol,
 static int rt5677_dsp_vad_put(struct snd_kcontrol *kcontrol,
 		struct snd_ctl_elem_value *ucontrol)
 {
-	struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
-	struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
+	struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+	struct rt5677_priv *rt5677 = snd_soc_component_get_drvdata(component);
+	struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
 
 	rt5677->dsp_vad_en = !!ucontrol->value.integer.value[0];