From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754187AbbHBAMd (ORCPT ); Sat, 1 Aug 2015 20:12:33 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:36171 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752004AbbHBAJv (ORCPT ); Sat, 1 Aug 2015 20:09:51 -0400 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Koro Chen" , "Mark Brown" Date: Sun, 02 Aug 2015 01:02:37 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.2 087/164] ASoC: dapm: Modify widget stream name according to prefix In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.249 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.2.70-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Koro Chen commit fdb6eb0a12871d5bfaf266c5a0d5259a5437a72f upstream. When there is prefix specified, currently we will add this prefix in widget->name, but not in widget->sname. it causes failure at snd_soc_dapm_link_dai_widgets: if (!w->sname || !strstr(w->sname, dai_w->name)) because dai_w->name has prefix added, but w->sname does not. We should also add prefix for stream name Signed-off-by: Koro Chen Signed-off-by: Mark Brown [bwh: Backported to 3.2: - Adjust context - s/prefix/dapm->codec->name_prefix] Signed-off-by: Ben Hutchings --- sound/soc/soc-dapm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2675,12 +2675,18 @@ int snd_soc_dapm_new_control(struct snd_ kfree(w); return -ENOMEM; } - if (dapm->codec && dapm->codec->name_prefix) + if (dapm->codec && dapm->codec->name_prefix) { snprintf(w->name, name_len, "%s %s", dapm->codec->name_prefix, widget->name); - else + if (widget->sname) + w->sname = kasprintf(GFP_KERNEL, "%s %s", + dapm->codec->name_prefix, + widget->sname); + } else { snprintf(w->name, name_len, "%s", widget->name); - + if (widget->sname) + w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname); + } switch (w->id) { case snd_soc_dapm_switch: case snd_soc_dapm_mixer: