From patchwork Wed Jul 6 01:09:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9215299 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E6D860752 for ; Wed, 6 Jul 2016 01:09:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C5EB205A9 for ; Wed, 6 Jul 2016 01:09:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2951206AF; Wed, 6 Jul 2016 01:09:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8396B28544 for ; Wed, 6 Jul 2016 01:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750828AbcGFBJN (ORCPT ); Tue, 5 Jul 2016 21:09:13 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:34933 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751076AbcGFBJM (ORCPT ); Tue, 5 Jul 2016 21:09:12 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie4.idc.renesas.com with ESMTP; 06 Jul 2016 10:09:09 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id B65F546434; Wed, 6 Jul 2016 10:09:09 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id B20288002D; Wed, 6 Jul 2016 10:09:09 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id B07728002F; Wed, 6 Jul 2016 10:09:09 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id LAM13844; Wed, 6 Jul 2016 10:09:09 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214963401" Received: from mail-pu1apc01lp0015.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.15]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 06 Jul 2016 10:09:09 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=N2mUc6MIN3ivwDznxh1nphAJP9jTf2dcbI/52TWS6A8=; b=U4zrB2C8MjCdRpE46AE1rxckeplTnC4GJZRNsuQ+UsMUo++o4E8fgRC94dg1iV3qBgYhh7oJQDIiR/yCxt4+U4kfhdf4fo5o/YAheuC0nIhHbo8e5ZNmurEi3Lv7V54fda2QsAan3Ia5ZL7zh5BA4ehQlie4S0/NkmdQWthmzvw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by PS1PR06MB1708.apcprd06.prod.outlook.com (10.167.53.18) with Microsoft SMTP Server (TLS) id 15.1.534.14; Wed, 6 Jul 2016 01:09:07 +0000 Message-ID: <87wpkzlgu3.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/7] ASoC: simple-card: use asoc_simple_card_parse_dailink_name() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Liam Girdwood CC: Linux-ALSA , Simon , In-Reply-To: <87zipvlgyf.wl%kuninori.morimoto.gx@renesas.com> References: <87zipvlgyf.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Wed, 6 Jul 2016 01:09:07 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0001.jpnprd01.prod.outlook.com (10.161.24.11) To PS1PR06MB1708.apcprd06.prod.outlook.com (10.167.53.18) X-MS-Office365-Filtering-Correlation-Id: 93416444-e4d3-474c-d243-08d3a53a217a X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1708; 2:iC23nYvQ0UWH5yuTpvrYPkXB/+SE1oGimyWE3qrxWPOEN/fRZ1XbTYraLfQ9x/p4vey6ERCOJr3ajbyy45NF5KUx9P+Q3gpgo5G+GMqIXnWgHA8Hr6y3WMhu1GAZWsrKb0jxzLBnvOnnxuIXghzU1WrsH116QGl51a4h3C7EVroPvUFEDI4NE7OMOK4R4E6t; 3:lpNsJGdrgIQBPH5oL7zZmPreIqmxHeasP+AkZPiWF3tQdX3FGM7Iadfl3U+aVTii8Yf16C0zJ6oDNTm0Oyxl5Bbvjg3uw9tuP/2oyY1MqiigFIwd+vMuBHLNiKA6i3L+ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR06MB1708; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1708; 25:+d8GeY0yQj7Y2XxLjW1VhLBIP9n5wxZNekDVquYWaHFl3BAeb4MH95Y27AvIlIPowNWKpezPYmTubu/DWXhEmnw8KEffK6SyhTszPz1ileWvdVwtqIsBIPOuAYtC2men20BHSNUhEcfcrGSQIn/taXuoOUqgJYs6TaDAqG8/UjBhHuFrMQ8SOmyFqkKy9BccQg3SVqST1V8A0FM5IWnVWMB9eemoFvvyhg6VNVx1Ly+Q1vcsXy4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IF4q+2DaFMRkPXR2qC32Nz4qYBqAPmm5vepPTgqasAJqo567yv7tvqS9o6h3q2ECN30gBN5CIn6JJzpkHWZ9n3tJ42hEIZH8uRHCrX/Q73yfWk0WItqc8Os4NglX0BCi8DdoXwLMA73YflbU8n; 4:tbMc7t2W+qxEggLjE2TPOvVENP7E4hSfBMwxS+Sw3UQGJ/YuL2zBT9NOs8iXyfBlICWSFCkqgRPTVZb7RLAkRx/XQgZCAkBnXIJq63qNwGr3eD8cTGXSP5MMCoMJlqNrDBMPMvJadVkFk3phNi8q0pes+dVhY7BdNRQZ7KqBQAt5pT4ItZOpXcnhUbo2WPkvj/71EPZTGVzr4xf/dlLRrDx1lYzZP0SaTi7hyY0XkVNcvFJj0HdvTTls2/FEcFKawnMedkKj9B6LSBUUt7KXjZJj8EroO0LC1i6sLjOgo+BlWiksE1oSvbGbFQI9SWsiCxoaXD0iD2isv5VdyVJcTaB5/fopGuwI6UbYJ/EOpNfw3fQPtjr6F5kGzdzJPd564gTmTit4wLFjQvnRI2kDRA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:PS1PR06MB1708; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1708; X-Forefront-PRVS: 0995196AA2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(586003)(36756003)(66066001)(305945005)(4326007)(229853001)(2906002)(4001350100001)(8676002)(3846002)(6116002)(97736004)(46406003)(5001770100001)(7736002)(7846002)(68736007)(81166006)(23726003)(50466002)(47776003)(189998001)(77096005)(19580405001)(53416004)(2950100001)(92566002)(42186005)(81156014)(83506001)(33646002)(50986999)(76176999)(106356001)(54356999)(19580395003)(105586002)(69596002)(86362001)(101416001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1708; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; PS1PR06MB1708; 23:jUoDBRgXqdsFgAx1xNvJan4BAF6bdZ3O/sPAqYk7u?= =?us-ascii?Q?DIlmY1pg0eX+aurChEtglSEkHb0/SdeUjPUwwK1saseFYAflVqqRdOc6/Uqw?= =?us-ascii?Q?Yi2RzjoFOI1oqkAKXNa96g+UEMLI6jEOvclIh35imTy0M7v3S400Vnvw49BD?= =?us-ascii?Q?PwE/yzBJJNSqkHUwgU947YzmUzJ2vQtL3FHj4ZkRcvXLSaN79JB5zd3U8x48?= =?us-ascii?Q?kEPwVdBn22OGZHqhzP9F7liIxjEhdnCCRJl/uO7GuKGKOy7hBwKI5jQl9G4v?= =?us-ascii?Q?z0axeTUFiEaNItfIiHaj+aaKfYuEwLvKBjIQOjA3E5PNe17HEGPtghxF4ENE?= =?us-ascii?Q?gH0aVOM0C7GD+KMTYqfjMh4qObXDTvVst0UaiYOIc9QuCE3mMzcuxpbexiOa?= =?us-ascii?Q?TOoH9rxa+Eo6LORyp98fSru7eQCFoVsHjy5KmTQqXG7le85ieN2xf3x9o3Qj?= =?us-ascii?Q?F7iTtOfWSXL2m6A0G+0yoGAA/lb2Nvh7nbd5Kgo3dGZVZNkNJR/bGX2G5lhi?= =?us-ascii?Q?dGFMz9KQIv2LBj+MCCGu3lnlfK3iLzDZND4X4xbrhM8Njx9dgvXA/tK2Az4/?= =?us-ascii?Q?BmCqt9EriIT5ix67uNDbF/IFGSWMfe3To0w2Cki4eYZDCaYii89zKYSCYjl8?= =?us-ascii?Q?q8CfGJrJcYtesg/iH6Qwamlef6rE39+gXEXyQK48zED0i/FotGb7weQ3Ik0K?= =?us-ascii?Q?ZUxq+8fXSESfBzcsUT+AdroYemF230aPVtjVTSc9fjieqP9LxobBl6KD1JvY?= =?us-ascii?Q?NWH1dwssdqhBmW6CL9MxDBQtNvcQ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mRWSasQOssje11dDymN4WKgP93sHapN0PCc8x5T+sdaJgRPDz7urX1glVuxvU=; 7:OgYCHW23/2+5WmeNHoh4NHuwR4pwWZm48TCIPbmN0dw84ZRijgmbER4Wfrix5Ucpio5OvMtZw4PRz4dmOEl4MreEHunjitAya2R943W/zJSBt6T9f2dK5FZ3BkTko2VCe1tHUAnhkcGBSR3ZZdr3iSZnseQGDQyvcwWh7zsSeoSZ9IBzkirELJw/zKiA1xfadtb1AnFp7+O+K5RT8/DtHrEfpDLZ7bCdCoQdcIuEiOiNQ/kNBuCVWmzVGY32Udo1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1708; 20:cw8VcT4I7duYnm0R5dME6W50HN5lCiBRVyat9v5THZeUEQ+8O0BAnIU/iKwbxA3v+oSZt7Z6l3jly6I61VIX/ERgEK/vnmy0Er/UNmbgX5yoDtgsviB8JCzn0ZeLaEv4bIK/vHBjfF4yb2I1mVolFRQJiw/d36aGmHHuQxZjv+8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2016 01:09:07.4042 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1708 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index e3a32d3..07469cd 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -319,7 +319,6 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, struct device_node *cpu = NULL; struct device_node *plat = NULL; struct device_node *codec = NULL; - char *name; char prop[128]; char *prefix = ""; int ret, cpu_args; @@ -380,19 +379,13 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, if (!dai_link->platform_of_node) dai_link->platform_of_node = dai_link->cpu_of_node; - /* DAI link name is created from CPU/CODEC dai name */ - name = devm_kzalloc(dev, - strlen(dai_link->cpu_dai_name) + - strlen(dai_link->codec_dai_name) + 2, - GFP_KERNEL); - if (!name) { - ret = -ENOMEM; + ret = asoc_simple_card_set_dailink_name(dev, dai_link, + "%s-%s", + dai_link->cpu_dai_name, + dai_link->codec_dai_name); + if (ret < 0) goto dai_link_of_err; - } - sprintf(name, "%s-%s", dai_link->cpu_dai_name, - dai_link->codec_dai_name); - dai_link->name = dai_link->stream_name = name; dai_link->ops = &asoc_simple_card_ops; dai_link->init = asoc_simple_card_dai_init;