From patchwork Wed May 7 14:20:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 4128891 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 2FA769F23C for ; Wed, 7 May 2014 14:21:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 660FE202B8 for ; Wed, 7 May 2014 14:21:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2EA5C20259 for ; Wed, 7 May 2014 14:21:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 349432654B5; Wed, 7 May 2014 16:21:20 +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 3DEC72652CD; Wed, 7 May 2014 16:20:45 +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 3C84426532E; Wed, 7 May 2014 16:20:43 +0200 (CEST) Received: from smtp-out-016.synserver.de (smtp-out-029.synserver.de [212.40.185.29]) by alsa0.perex.cz (Postfix) with ESMTP id 2A9A9261AF0 for ; Wed, 7 May 2014 16:20:35 +0200 (CEST) Received: (qmail 419 invoked by uid 0); 7 May 2014 14:20:34 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 32671 Received: from p4fe61b87.dip0.t-ipconnect.de (HELO lars-adi-laptop.analog.com) [79.230.27.135] by 217.119.54.96 with SMTP; 7 May 2014 14:20:33 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Wed, 7 May 2014 16:20:25 +0200 Message-Id: <1399472428-11034-2-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1399472428-11034-1-git-send-email-lars@metafoo.de> References: <1399472428-11034-1-git-send-email-lars@metafoo.de> Cc: Songhee Baek , Arun Shamanna Lakshmi , alsa-devel@alsa-project.org, Lars-Peter Clausen Subject: [alsa-devel] [PATCH v2 2/5] ASoC: Revert "ASoC: dapm: Fix double prefix addition" 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 This reverts commit bd23c5b661858446267f4d6b2fb4edd8eb710dda. The patch claims that the patch is necessary to avoid double prefix addition when calling snd_soc_dapm_add_route() from snd_soc_dapm_connect_dai_link_widgets(). But snd_soc_dapm_add_route() is called with the card's DAPM context, which does not have a prefix, which means there is no prefix that could be added a second time. Signed-off-by: Lars-Peter Clausen --- I might be missing something. My best guess is that this was needed in some vendor tree, but not in upstream. --- sound/soc/soc-dapm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 142a738..08d869c 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2381,8 +2381,7 @@ err: } static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, - const struct snd_soc_dapm_route *route, - unsigned int is_prefixed) + const struct snd_soc_dapm_route *route) { struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w; struct snd_soc_dapm_widget *wtsource = NULL, *wtsink = NULL; @@ -2392,7 +2391,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, char prefixed_source[80]; int ret; - if (dapm->codec && dapm->codec->name_prefix && !is_prefixed) { + if (dapm->codec && dapm->codec->name_prefix) { snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s", dapm->codec->name_prefix, route->sink); sink = prefixed_sink; @@ -2520,7 +2519,7 @@ int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); for (i = 0; i < num; i++) { - r = snd_soc_dapm_add_route(dapm, route, false); + r = snd_soc_dapm_add_route(dapm, route); if (r < 0) { dev_err(dapm->dev, "ASoC: Failed to add route %s -> %s -> %s\n", route->source, @@ -3430,7 +3429,7 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) cpu_dai->codec->name, r.source, codec_dai->platform->name, r.sink); - snd_soc_dapm_add_route(&card->dapm, &r, true); + snd_soc_dapm_add_route(&card->dapm, &r); } /* connect BE DAI capture if widgets are valid */ @@ -3441,7 +3440,7 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) codec_dai->codec->name, r.source, cpu_dai->platform->name, r.sink); - snd_soc_dapm_add_route(&card->dapm, &r, true); + snd_soc_dapm_add_route(&card->dapm, &r); } }