From patchwork Mon Jul 6 13:38:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 6724351 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F999C05AD for ; Mon, 6 Jul 2015 13:39:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71A8920524 for ; Mon, 6 Jul 2015 13:39:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D8D37206DC for ; Mon, 6 Jul 2015 13:39:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F06C0264F10; Mon, 6 Jul 2015 15:39:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BE34326087E; Mon, 6 Jul 2015 15:38:31 +0200 (CEST) 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 A60CF26087E; Mon, 6 Jul 2015 15:38:29 +0200 (CEST) Received: from smtp-out-092.synserver.de (smtp-out-092.synserver.de [212.40.185.92]) by alsa0.perex.cz (Postfix) with ESMTP id 7EFFC2606E8 for ; Mon, 6 Jul 2015 15:38:23 +0200 (CEST) Received: (qmail 25004 invoked by uid 0); 6 Jul 2015 13:38:23 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 24664 Received: from ppp-188-174-59-27.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [188.174.59.27] by 217.119.54.81 with SMTP; 6 Jul 2015 13:38:22 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Mon, 6 Jul 2015 15:38:10 +0200 Message-Id: <1436189891-15343-5-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436189891-15343-1-git-send-email-lars@metafoo.de> References: <1436189891-15343-1-git-send-email-lars@metafoo.de> Cc: Oder Chiou , alsa-devel@alsa-project.org, Lars-Peter Clausen , Yang A Fang , Peter Ujfalusi , Bard Liao , Kevin Cernekee , Jarkko Nikula Subject: [alsa-devel] [PATCH 5/6] ASoC: dapm_widget_show_codec: Use component instead of CODEC 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 There is nothing snd_soc_codec specific in this function, just use snd_soc_component instead. With this also the last reference of snd_soc_codec form soc-dapm.c. Signed-off-by: Lars-Peter Clausen --- sound/soc/soc-dapm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index a47a8ce..f7d93a8 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2220,14 +2220,16 @@ int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, } EXPORT_SYMBOL_GPL(snd_soc_dapm_mixer_update_power); -static ssize_t dapm_widget_show_codec(struct snd_soc_codec *codec, char *buf) +static ssize_t dapm_widget_show_component(struct snd_soc_component *cmpnt, + char *buf) { + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); struct snd_soc_dapm_widget *w; int count = 0; char *state = "not set"; - list_for_each_entry(w, &codec->component.card->widgets, list) { - if (w->dapm != &codec->dapm) + list_for_each_entry(w, &cmpnt->card->widgets, list) { + if (w->dapm != dapm) continue; /* only display widgets that burnm power */ @@ -2255,7 +2257,7 @@ static ssize_t dapm_widget_show_codec(struct snd_soc_codec *codec, char *buf) } } - switch (codec->dapm.bias_level) { + switch (snd_soc_dapm_get_bias_level(dapm)) { case SND_SOC_BIAS_ON: state = "On"; break; @@ -2282,8 +2284,9 @@ static ssize_t dapm_widget_show(struct device *dev, int i, count = 0; for (i = 0; i < rtd->num_codecs; i++) { - struct snd_soc_codec *codec = rtd->codec_dais[i]->codec; - count += dapm_widget_show_codec(codec, buf + count); + struct snd_soc_component *cmpnt = rtd->codec_dais[i]->component; + + count += dapm_widget_show_component(cmpnt, buf + count); } return count;