Skip to content

Commit

Permalink
ASoC: rt5677: fixed rt5677_dsp_vad_put rt5677_dsp_vad_get panic
Browse files Browse the repository at this point in the history
snd_kcontrol_chip should return snd_soc_component instead of
snd_soc_codec

Signed-off-by: Fang, Yang A <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Fang, Yang A authored and broonie committed Dec 24, 2014
1 parent 97bf6af commit 6087fca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sound/soc/codecs/rt5677.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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];

Expand Down

0 comments on commit 6087fca

Please sign in to comment.