From patchwork Thu Oct 3 15:53:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175090 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp512648ill; Thu, 3 Oct 2019 08:58:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyk/kQ/XPKJbtQrf6+9LnrxS1A1SDh+qrnzCTq9W/GbeoUG3p2qkBiiVy+KHkIZRuAWDv94 X-Received: by 2002:a17:906:134b:: with SMTP id x11mr8232484ejb.272.1570118327059; Thu, 03 Oct 2019 08:58:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118327; cv=none; d=google.com; s=arc-20160816; b=ZEPHltaCyKrXKaG2se7GlBIehrOi7w+8rvxPeipWlfcXzv4nHh0bVBzYim5dYqXUDU HN4js5un1XRPqzwIIF0xMxUHuaQHSNueUdtn62Eoduxyqt5v6g79cgpqljldCVYdm4l7 DSX63V7aEB62+aHYBBWD4CDLAoBfnnfMGT501+O/QRIB1hzJu0wt9de2Akc3KHsh1HIk xx5k66E7Yi2ekaGc39CzcaS2Qe6T5vse5Xk5k2b8UR4iRzp42XZNW/H6xU9sPWLMck4G OO96bk3IzskPYUX7HiUxF4nukpnrdyqCuKqLZtBSdZx1YAHn2JAv8kalNu/yyTUQPyNn ne1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TrHNPkemY5sNfrWgGiuF6eXFFQB5y4Q7TXd0qEx/fjU=; b=YEDMGmXpI4X5dDen2kAGJqTLtoJHUVFgtXy443RuK1VfIkWb+FajZ2U9iiuSCjhSGw dpOcPdT0xD5+kLNxlsFGFUs/H3sWWN9MzUMVs+5eZoRO2N/B29tLm+Nb5EZgEqBMjXsa Wc7guMiu1U6wBZyrN0mt+b20zXxJ+/GjLXUq94Fzj+JvJybTQdk3fu1AA26S8tzBQGpT sQF0hugjcUGs1URvdyTgUnxTELChcDf5i+ydoW+u7StfpTdX5ciI8/ljeJIR0oPCqNf2 tN0COv1HYIqi8M0tjz0Q0oaSNk8FE10vmvIsO8F8g4q91LthrfrD2v8c+qa1klPe0M96 uNvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fchApmjo; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si1492851ejb.48.2019.10.03.08.58.46; Thu, 03 Oct 2019 08:58:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fchApmjo; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727624AbfJCP6n (ORCPT + 14 others); Thu, 3 Oct 2019 11:58:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:41536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731279AbfJCP6n (ORCPT ); Thu, 3 Oct 2019 11:58:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0893120700; Thu, 3 Oct 2019 15:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570118322; bh=ajS824LenRlv1kgE8cKvjNmdtuc51nUxbHZHmDxrsXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fchApmjodAlmit9FMs4Wz3KVIFC0ZqnV48lC4MrzKEIwEt8xa2+WJTyjJc0epVsPU Ts/FPYjVEzFDcjKjLf1Med/bGJEndSqk3sznqeKxdQ5asU/GZZ8Vsw6hedGmC4elvR OqmR4rE72+mhwwQtlwFWgOKJ/myHHtndKT4cghZ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Arthur She , Mark Brown , Sasha Levin Subject: [PATCH 4.4 69/99] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Date: Thu, 3 Oct 2019 17:53:32 +0200 Message-Id: <20191003154330.805351034@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154252.297991283@linuxfoundation.org> References: <20191003154252.297991283@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Peter Ujfalusi [ Upstream commit 2ec42f3147e1610716f184b02e65d7f493eed925 ] Some tools use the snd_pcm_info_get_name() to try to identify PCMs or for other purposes. Currently it is left empty with the dmaengine-pcm, in this case copy the pcm->id string as pcm->name. For example IGT is using this to find the HDMI PCM for testing audio on it. Signed-off-by: Peter Ujfalusi Reported-by: Arthur She Link: https://lore.kernel.org/r/20190906055524.7393-1-peter.ujfalusi@ti.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-generic-dmaengine-pcm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 6fd1906af3873..fe65754c2e504 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -301,6 +301,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; + + if (rtd->pcm->streams[i].pcm->name[0] == '\0') { + strncpy(rtd->pcm->streams[i].pcm->name, + rtd->pcm->streams[i].pcm->id, + sizeof(rtd->pcm->streams[i].pcm->name)); + } } return 0;