From patchwork Mon Jul 11 23:57:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9224409 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 4961060572 for ; Mon, 11 Jul 2016 23:57:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3817226252 for ; Mon, 11 Jul 2016 23:57:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29AA627F7A; Mon, 11 Jul 2016 23:57:42 +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 F2CF626252 for ; Mon, 11 Jul 2016 23:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751559AbcGKX5k (ORCPT ); Mon, 11 Jul 2016 19:57:40 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:10636 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751365AbcGKX5j (ORCPT ); Mon, 11 Jul 2016 19:57:39 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 12 Jul 2016 08:57:37 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 62D173FA60; Tue, 12 Jul 2016 08:57:37 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 42C988002E; Tue, 12 Jul 2016 08:57:37 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 3C2138002D; Tue, 12 Jul 2016 08:57:37 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id JAF02697; Tue, 12 Jul 2016 08:57:37 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214867775" Received: from mail-sg2apc01lp0243.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.243]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 12 Jul 2016 08:57:36 +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=c0TAgALb3ZXaPeRXaMMnLwQbww3QZnwPlg0+gV0Urhg=; b=Ofah8Nd/C/O/GEBQS0EcFYLIpvOhK3hotIlnrBpj8yXj0PmrozWQ+6t/2V363GTEbz9co5n4f0bdZXZX/AxLbcoDKByjzd/x8yXJD0TZQ4VX7ilnVzJL+H4yjovNVSQ+59PVEBGf1b31yeAOdo0NzV4+jLuI+gww67OGswY8/Ao= 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 KL1PR0601MB1447.apcprd06.prod.outlook.com (10.169.69.25) with Microsoft SMTP Server (TLS) id 15.1.539.14; Mon, 11 Jul 2016 23:57:34 +0000 Message-ID: <87d1mjn39i.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/7 v2] ASoC: simple-card: use asoc_simple_card_parse_dailink_name() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87furfn3bj.wl%kuninori.morimoto.gx@renesas.com> References: <87furfn3bj.wl%kuninori.morimoto.gx@renesas.com> Date: Mon, 11 Jul 2016 23:57:34 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TY1PR01CA0072.jpnprd01.prod.outlook.com (10.167.153.160) To KL1PR0601MB1447.apcprd06.prod.outlook.com (10.169.69.25) X-MS-Office365-Filtering-Correlation-Id: f3958e7a-c342-458a-32d3-08d3a9e7211e X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1447; 2:UD4K6aCMMCwtAiWTo0tkxPHChuPtZFvYsUCvGpA61rUVHXK1pyjR7l2SkIGmA4keGuEhotTV9z5ImXpPr5dDgZO97wOwDo65RCG+IXq4syoNCDelTeg9oewgeWBLvqmYv8E/PN3zhqtclcfS1xieuaC6wHjVRX00LV4w/Q9ZnoCE2sJSY/y4zMRCPJwMrHwd; 3:B47L+YvwaLAfULyGJ8TR50wk4LFg+aRcvXuMvsgKUeqp8ez0Z2PyMAYqQQpekxQE7sFWukZ9Mkhb+b63BGu3ooLDW1UWEvK9CKat7pGukiGe6bh/NjvYaiYW+Cbq8TgW X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR0601MB1447; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1447; 25:OPKOJq8oumqJXwEvj13FC7dnh+JMl5ixkuyHKnJlNGGPthZgBCJU8gQCXMPu1Nyjnx21A2PaalW5rM8rZCYsHPDgAe0FAndWU5OwJ2ozuDsgP7P4NUeNDcGOBQMhSoISB/QD3MdvBsmM7N0+9CFoP6xZGRNpFkBkX0xckMaitTVar2ZuFf6Yel2U2mW3ah1aWyyhYQYvMSYCaNFqeK5y7Y3yaHyEHZwJ+QGTLEEzOI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UBIsYkdkPMC+34Mt7r1xkxFy/KsBWlqNxbJkeggoTEKQBT156cDTxjeElX5PAZbfhFuBpf3B9fqK+RhJvLAaQr5y6oR9blDOMQ+AMoGw69eyU8QAQZ5Obve1+fcp6ldFY9NZqN4x0Oesltje3tmy0XNx504+3D0VIoz5JojxQgfglz5G1l92dhGpkl; 4:9IzcluHfE+GGoy1b+Ww70hFyIYzlEW8qiAGtZqfdB9qGWfefVWdjbu+7wcvFpQuqBIHjWhvvz5dmA7AfzTtyXfva4QRWHrT9v0rLxFISpXCR/mq8MYcuIPoVI+DuWGUuNuD+G7o9zcRLEMTlxrh65M1i8nyaItmxqstGthmwaF5EpiA736aZouxr4/DOxPSyqQ7CHkFFhN+aeZudtzKaQXo0Q2f2Utd4xdCRak5B6iDWPdXymhVo5JFeffTNxx8Qoq0630kVhF2utV3vAWMPeAVEJxdO9DISAHAwBT5ZSVsNctj84eH2dNRb5ABM5hJBGBh32ChLhG29rP8glgSoZtqMSIOBmE7DFCGrZHDoNK6S0VDlZ/XcwkRCeT25oH2pSCPR361M9ZZXG0k7ipY0dw== 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)(10201501046)(3002001)(6055026); SRVR:KL1PR0601MB1447; BCL:0; PCL:0; RULEID:; SRVR:KL1PR0601MB1447; X-Forefront-PRVS: 00003DBFE7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(2950100001)(46406003)(66066001)(92566002)(101416001)(7846002)(19580405001)(69596002)(68736007)(105586002)(33646002)(77096005)(47776003)(8676002)(81156014)(189998001)(81166006)(50986999)(106356001)(76176999)(54356999)(7736002)(2906002)(19580395003)(4326007)(36756003)(305945005)(110136002)(586003)(83506001)(86362001)(23726003)(3846002)(6116002)(97736004)(53416004)(4001350100001)(42186005)(229853001)(50466002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1447; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR0601MB1447; 23:eHpJe+4q6g4N3M9VM89gTTaoQMgWzskAR54sU5o?= =?us-ascii?Q?liAwQKi9IkZH9CNvzcB2fi3kjTKdPa24YvfRtqePJjjnmiHSpqy2qqgVhYTC?= =?us-ascii?Q?nfiiER9C5MNjwCpuLTM4XHLmwKBj+jkPt72fEJ/di/yg5J2AWIpy0ZyC58BC?= =?us-ascii?Q?TmULVP94eazRdFCzsDzPd5ue0IB00f0CKE4c3CsuJXSVSwH6wYhJg5DOe2VG?= =?us-ascii?Q?8gf1W1J993lBDNU5OYrjugs/paDC62O9wWG/AvY+V57PiGgmMXHNbBaKJHqH?= =?us-ascii?Q?AZIqTWStabySN6y9J/Et3ivvzhMG9N3a9uyWMyqnkiULPAvAcdORPypF4USw?= =?us-ascii?Q?Laa++AdPDEioIM3zEhr/8jcLIOq3VOhy1tZgme58qfqtMMDaBtLi4FMkkOpo?= =?us-ascii?Q?STz8wjW5G8uCHSfv/O/0SHfIuyH1/bE6dXEhG0eqOS7kaoPYzaYZCcWaedB7?= =?us-ascii?Q?ZxsjBBsObk4YR+1sgKCbthFv6p7Xs7E2vkNfa4UasnMZkR/eFTEmvYDGykpc?= =?us-ascii?Q?gfIq/IZZ8VsDG/EDk2F88AhqYvL6Z6cMr1k+RAk2rHouaic0oLf85PWJqqjs?= =?us-ascii?Q?UwVppjFK17BbpIPLNouIs82AIe8ys9htSkbeF0cNV6gUguU6+G49fheqQ8sW?= =?us-ascii?Q?twwGZnNxydN+WvGW8uKHhAzErK1O6e+yFuROD7/8ae4DptiwlW5B134ZfFd6?= =?us-ascii?Q?Ph3YwIIfFXROXpfQuUH1VmG5ZGtmcZIXo5jotmCI49DQ4MCjG8+xnrbtaRts?= =?us-ascii?Q?6EwNYCZ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bNDaewiFuQ0kqZX3ZjI1ykC/4sZ2guSIfoTurhauid5k+RAsKzgoRPvk2ASgqoP9tKIgTj5kHlqimUhwBpiirfqw=; 7:EUtQdtOMRbZF+acp5iUXM9Jt6V60XOq+WA99fnrvh1uscPnuTIPCPEBbuCwpUitwcM3AH15iYApbGaaz5k/rxhkz3MmteFRaRp4Gb6ES3sz/QrevusQj2lWC7zMWr5jS+I86NUOMqTFpVEWqEdO6EV1/lmOvEqFH4hyNPVH0UI7DfHcbf8KsgFYsbvCYxiDBNN6UmfCKarvOcDdYJR/GszAVFq8EJrl+CfXjAfCcO13vJziRK0bI7auPwUMkvOcm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1447; 20:ERs3a+TeTSQHUO8eTagT4patptNqj5b89trFhEGr4TTx8dgjgwfgPH55qU0luELcaZEcm7BPNr8Q4yhFq60qMhwoeKrhjypFPAWs+zChlRRIwngOvJlIaYT5cAOBNyX2kor7fDQvT0uD79B8SAXw403RAGqiVGDgFeUbKFc9J6A= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2016 23:57:34.0522 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1447 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 --- v1 -> v2 - no change 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;