From patchwork Wed Dec 24 03:49:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yang.a.fang@intel.com X-Patchwork-Id: 5537671 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E98D89F1CD for ; Wed, 24 Dec 2014 07:51:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 264B7201C7 for ; Wed, 24 Dec 2014 07:51:20 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D02B72012E for ; Wed, 24 Dec 2014 07:51:18 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B621E26170F; Wed, 24 Dec 2014 08:51:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=1.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, NO_DNS_FOR_FROM,SUBJ_OBFU_PUNCT_MANY,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 79CBD2615BF; Wed, 24 Dec 2014 08:51:06 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D05CB261600; Wed, 24 Dec 2014 08:51:05 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by alsa0.perex.cz (Postfix) with ESMTP id 6507F260882 for ; Wed, 24 Dec 2014 08:50:57 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 23 Dec 2014 23:50:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,637,1413270000"; d="scan'208";a="628585366" Received: from mocha.sc.intel.com ([143.183.249.83]) by orsmga001.jf.intel.com with ESMTP; 23 Dec 2014 23:50:51 -0800 From: yang.a.fang@intel.com To: broonie@kernel.org, lgirdwood@gmail.com Date: Tue, 23 Dec 2014 23:49:05 -0400 Message-Id: <1419392945-29971-1-git-send-email-yang.a.fang@intel.com> X-Mailer: git-send-email 1.7.9.5 Cc: oder_chiou@realtek.com, alsa-devel@alsa-project.org, "Fang, Yang A" , praveen.k.jain@intel.com, kevin.strasser@intel.com, denny.iriawan@intel.com, bardliao@realtek.com Subject: [alsa-devel] [PATCH] ASoC: rt5677: fixed rt5677_dsp_vad_put rt5677_dsp_vad_get panic X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Level: * From: "Fang, Yang A" snd_kcontrol_chip should return snd_soc_component instead of snd_soc_codec Signed-off-by: Fang, Yang A --- sound/soc/codecs/rt5677.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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];