From patchwork Thu Oct 3 15:53:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175121 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp547155ill; Thu, 3 Oct 2019 09:22:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk9exjJ/QaLiwtL8q7skMhKMf/alpbi9nXynC0PrNdEFJ6sIVSSTva8Y5rxu95kSovxvEx X-Received: by 2002:a50:a7e4:: with SMTP id i91mr10751589edc.9.1570119627367; Thu, 03 Oct 2019 09:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570119627; cv=none; d=google.com; s=arc-20160816; b=VBkwmN7ODUnhMe8iYCTtlRcfIx2nzGYIjOcmnpnD2AGqbUTZqbsfCFq+m2v45etfnM SpDtLv4aYsLTaV3obpyEEKuWvcNr5d6m4ZNut247wS8vGw7OFmnSrbbSg2zJsgpK9EYt X9faqz9ZeeYpi3jtSCCdIedmcBQqm5M4G3aqnfhJDnl/Xp10dgTFaJjEuOHzSx1Ok5Vq jMITQoL0OK1HjzdKQTaqUDJRKSe7WhW+DW/l2Bow1S38hxmW80ivsGXEgWTKnxl9MpJm w0e9gHAM9qgIZGqLwV/Zq1Y87vMe0bVazIeCmnFzdeZ+EzROM4X9INpLFlryN8CODHRh njQQ== 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=nTEUTzKCYKHQ//W/2PmIV/t05oIW+b8KM7NKmQA0r4k=; b=S0vmDPYX88ndSx6USWdV+E0SZRJ2N8Mg/OrBOa3fy1D9MHpxKgMCVA4WrYOu0dXtn9 l78AZGy0B3fjZpwoF8eWswUBpoIwfLl1T2+4nuw7HXBG+L4XipGI6uk2cCCHDGltXWF6 R3mqOy/N/1TruH+622T5+YT/RdGZWQhQwaLVNRnYHi+G1jHiAHSAzMDkTuTOuY/Ktcix nDVXz8mP+WP6flqW9ZHs16qdhvv7lAmi/yK3q8trytF6Kb2Bl3sKDBBxxqmcknAPzTch XnuWKbim89N2bSYgFuK5/YpOwKhxp5LGrX7Qsk282X5kaKV92aY/W6sR1IA3OFQbMl1P LZ0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GdSdZcWr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 y64si1851409edy.434.2019.10.03.09.20.27; Thu, 03 Oct 2019 09:20:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=GdSdZcWr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389892AbfJCQUW (ORCPT + 27 others); Thu, 3 Oct 2019 12:20:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:47868 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388650AbfJCQUT (ORCPT ); Thu, 3 Oct 2019 12:20:19 -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 034A9215EA; Thu, 3 Oct 2019 16:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119618; bh=fLXXfy+8DeSWD+W67ibSeRkxDybWu5Ovr0GanZ2/0q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GdSdZcWr61nFHw6zbUi2lQIr/xgLALYVaisaww+k7aXo+MJsFydDBWYdY23+kCxrk BufK8hS2LyN1pT5u7mF/U3RP1hA9ZmLp/osr0gZunmHj4v2AQfvzIZIn9Sh9gOGrk5 Jk8Q3BMX57rwbHQKlL66lH40iAuBJygIzTC0NFS8= 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.19 131/211] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Date: Thu, 3 Oct 2019 17:53:17 +0200 Message-Id: <20191003154516.761460881@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 30e791a533528..232df04ca5866 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -313,6 +313,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;