Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>
Cc: Songhee Baek <sbaek@nvidia.com>,
	Arun Shamanna Lakshmi <aruns@nvidia.com>,
	alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 4/5] ASoC: dapm: Use snd_soc_dapm_add_path() in snd_soc_dapm_new_pcm()
Date: Wed,  7 May 2014 15:05:47 +0200	[thread overview]
Message-ID: <1399467948-8770-4-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1399467948-8770-1-git-send-email-lars@metafoo.de>

We already know the widgets we want to connect, so use snd_soc_dapm_add_path()
instead of snd_soc_dapm_add_route() in snd_soc_dapm_new_pcm().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/soc-dapm.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index e28ce91..de48cab 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3247,6 +3247,7 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 	struct snd_soc_dapm_widget *w;
 	size_t len;
 	char *link_name;
+	int ret;
 
 	len = strlen(source->name) + strlen(sink->name) + 2;
 	link_name = devm_kzalloc(card->dev, len, GFP_KERNEL);
@@ -3275,13 +3276,10 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 
 	memset(&routes, 0, sizeof(routes));
 
-	routes[0].source = source->name;
-	routes[0].sink = link_name;
-	routes[1].source = link_name;
-	routes[1].sink = sink->name;
-
-	return snd_soc_dapm_add_routes(&card->dapm, routes,
-				       ARRAY_SIZE(routes));
+	ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL);
+	if (ret)
+		return ret;
+	return snd_soc_dapm_add_path(&card->dapm, w, sink, NULL, NULL);
 }
 
 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
-- 
1.8.0

  parent reply	other threads:[~2014-05-07 13:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07 13:05 [PATCH 1/5] ASoC: dapm: Skip CODEC<->CODEC links in connect_dai_link_widgets() Lars-Peter Clausen
2014-05-07 13:05 ` [PATCH 2/5] ASoC: Revert "ASoC: dapm: Fix double prefix addition" Lars-Peter Clausen
2014-05-07 13:05 ` [PATCH 3/5] ASoC: dapm: Use snd_soc_dapm_add_path() in connect_dai_link_widgets() Lars-Peter Clausen
2014-05-07 13:05 ` Lars-Peter Clausen [this message]
2014-05-07 13:35   ` [PATCH 4/5] ASoC: dapm: Use snd_soc_dapm_add_path() in snd_soc_dapm_new_pcm() Lars-Peter Clausen
2014-05-07 13:05 ` [PATCH 5/5] ASoC: dapm: Simplify snd_soc_dapm_link_dai_widgets() Lars-Peter Clausen
2014-05-07 13:55 ` [PATCH 1/5] ASoC: dapm: Skip CODEC<->CODEC links in connect_dai_link_widgets() Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399467948-8770-4-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=aruns@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=sbaek@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox