From patchwork Mon Jul 11 23:58:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9224411 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 7621C60572 for ; Mon, 11 Jul 2016 23:58:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67AA926252 for ; Mon, 11 Jul 2016 23:58:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C0BC27F7A; Mon, 11 Jul 2016 23:58:34 +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 1EB2926252 for ; Mon, 11 Jul 2016 23:58:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751559AbcGKX6c (ORCPT ); Mon, 11 Jul 2016 19:58:32 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:61243 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751673AbcGKX6b (ORCPT ); Mon, 11 Jul 2016 19:58:31 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 12 Jul 2016 08:58:29 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 3BF9A3FB18; Tue, 12 Jul 2016 08:58:29 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 1B38F480A4; Tue, 12 Jul 2016 08:58:29 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 142AB480A3; Tue, 12 Jul 2016 08:58:29 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id JAA07843; Tue, 12 Jul 2016 08:58:28 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214867822" Received: from mail-pu1apc01lp0019.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.19]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 12 Jul 2016 08:58:28 +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=PpH/eve+ZiPDzv/2Hl80yquaFma/MaFeGJilee3gH2E=; b=Sb5O8fOYWp7NtayYIFYQbIxKcOZusxktcrGmNfqyHxY7jvtQVevKvoV5WSUjQ0ElZgJOZbPYfhEix8rIDGcXj9IqqGr7gmGnLvzTMOb/vNgXlPcaqm406g2pGvf8wmskTIkTCvgXdOqaiPo+RU/5G5htTenDxwaGKD04L5Y1oVM= 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 HK2PR0601MB1444.apcprd06.prod.outlook.com (10.165.182.150) with Microsoft SMTP Server (TLS) id 15.1.534.14; Mon, 11 Jul 2016 23:58:25 +0000 Message-ID: <87bn23n386.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/7 v2] ASoC: rsrc-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:58:25 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0019.jpnprd01.prod.outlook.com (10.161.225.157) To HK2PR0601MB1444.apcprd06.prod.outlook.com (10.165.182.150) X-MS-Office365-Filtering-Correlation-Id: f27fe7f4-ab57-4392-44d7-08d3a9e73ffc X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1444; 2:VHpfhL5wjdLBR3/G3NpG+3R31NJMwrFLHsrSJV1R8eHKowKi0PTpezZ5lgJuBQa6/G1o4YYmIrSlcBypVLqo+t5EEbFbvfHzPkbmLpb3X0DRV28J/H6HcehTtdpyUBKA0WdVVR/tOF0AIh43ErGGlZd09bw9hNb/hebu3KyoGbm8gKsFGavjyJWEvlYk0u7n; 3:dftyYHrUSUobY8VJ9dy+czjhoMvr+Yyoj6qXXU41FCKOlItszDHgYgS1U4doRW/nsjSnuTyYA42glvUj4BXpji2b7HIKb/H8o8eU74omsMwl0SrnDu6P/S0C37pvY4GT X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR0601MB1444; X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1444; 25:2Z1Vh+uQYboBsR7yLDaeNWQpH/Jnti+OlY/M6cz7BEbFwCGHhzdtyayLIBsJyH0Ki899cIbWuYnjDsO+ShPe1EM7jIwk+zgOGh/DXvLLF0xikfbzuat9qjYOGxpp1aREuQpEWR7A0t44yhD0Ib1HtmvZgOJMDiE4p72eJ7XagPilIPWumLpLprtC6gw/BFGKFCdejbC5cijXo/EfXkiOGdHG4yjGXi4ZGVLME2Iw9tghn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ojl431UZgMRVnb8eig3/j0kM73JtofbthUDqjKqJFNppXxwknmu6ai/pNRCfn3vAbbq/U7FvuCdKhN9uh58dpMEW9JsmhoTEEAf/I88F8IzH8/tkWByNKqPSdVV1ZJtrgJXWrLfVwiMjbCAtnfdPWk5ErSSfGfC8VeZExAPAxoHAX3b9fslBRzWa4lhEfiT+0TuL; 4:dru3fkMoU2m9rj9aTNNCmxVQqC8TtvOOaC8ocI/VfflhyYWFDbivJqF1l/z2vWXOLaP1YbnrXcB1l3N+62FrEAlBx2QW+F4UZBPTu7aBUekCJLxrGWjuYOqSgCwDWmPxbvSdPtu01lkhj5tN5QrSb5zaL8OwfhiFaPgIfv2FkbhD9EXbfbpX1PgRZMqUBXeTLfrxnhQu0NyFsUQU8mjjnsludq8BMvNpsVV5bPBxTWaD724dHO6PBEewwv9+2F3skDxifrV2g5KKnGW7F111vrL4KWVYOVtdY4MSKW4iOqSCbzFERX2XnfK85B8fS5pYuDkhm6Owy+apZNrLuC8Zi5yh4dCuYirGBAzBTfR8yLmrtYuvFkW2GXQUn9Qx3Djjng8lgKGvSXpfIrR3lEXxyQ== 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:HK2PR0601MB1444; BCL:0; PCL:0; RULEID:; SRVR:HK2PR0601MB1444; X-Forefront-PRVS: 00003DBFE7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(229853001)(106356001)(53416004)(42186005)(6116002)(3846002)(586003)(23726003)(47776003)(66066001)(50466002)(77096005)(68736007)(33646002)(2950100001)(19580405001)(19580395003)(189998001)(4001350100001)(97736004)(36756003)(110136002)(86362001)(92566002)(50986999)(101416001)(54356999)(76176999)(105586002)(7736002)(81156014)(305945005)(83506001)(81166006)(8676002)(4326007)(2906002)(7846002)(69596002)(46406003)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR0601MB1444; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR0601MB1444; 23:n1sNmwL0TvDgIglRg4PZqMToQ8Si5xubXm9OOe/?= =?us-ascii?Q?O4JwJABflDEqhK4+76PA6ZxOJeCyCRJkaXjUVRns6A0GGq7IxHy4I+I3RM4H?= =?us-ascii?Q?BeWsVH/Nd9fXBwBrma81H79excYsGTPB9E7b1aY1+4n5+bNVL8RRtJHAMM1T?= =?us-ascii?Q?v7pntS/ZNGFY355+Fh2qSz8DXC0HkR78nUpo0Vy0dTkv6Im+lNbXSegKIVWo?= =?us-ascii?Q?1eAuTONHQVZFP0YUBMVLGw9+thCDlGcv12pSEI4ApKa1LPrRjgDThasaw8R4?= =?us-ascii?Q?Vk5LHR0Bw4pqSVLARK+z3G1JoAVtX91E6UgJ8U6s8dQhCXk8HRowVs8m82p2?= =?us-ascii?Q?dnu0gHPQrEpJHF3/Jes2Hjj7BEHHbfc4HVhkxbSPpAgfrKF+/V4+PkwKT20l?= =?us-ascii?Q?s+ERQ7aByCf5OsHFLqt0p7+6/uZahffBFZZNPUHAGnUxDmmNYm5nkKZ1DT2p?= =?us-ascii?Q?oCwpIMLemsxXL2EdSJ25tT7Td/a07RIAaQOVXOytRp3l2bVbWeZhASsFeIkf?= =?us-ascii?Q?ZXQKXWfzw2HjsRa+4F+PBP1V5wFAPvauYAJBMqrMHXdnXXmVpQYKhEzsDcKc?= =?us-ascii?Q?rTCiNCVF/OA20MTym2ZxJh1RAjZYDqsgoPAI2eq1B7vUJQK8BbXUvoIx74y3?= =?us-ascii?Q?YTA8RtF3/FpjpTzUR3P1ZNH4J2KIhMxGwLOdfcBFjFy+e0Fr/fVX9Xu83mHL?= =?us-ascii?Q?ZVUAy6hc4Vg3+4Q5zr8ih+6VVL5YtXuGsT9To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FsMVi+rC+sw==; 24:qyLfbAmrLgW4AEPWPKRz1LqwANOPUSdg1oVwvXoSrJXIMkvGwZA9WK4h70ZR+llDQcxY3CmXT3NugJTl8GpokQeVg5jpb6vcD6WcrzY276c=; 7:u1wydLrFBwROpXOxAT+R9adYND3T4HNGZ1AKVbXtWCRiBwPlMFhYyCRmNOYsvO9N9Uc4OPIxJ2s8LFOQQZf/VtOkwm/VxOVlU4SjcAD+EY+O5nvLOEomd4nXL0n4xHsPLlk0wkCfpcvvQUaxbOvqBHC25Wuxt1Q0eGNj5sN2wVRkcmtuSAaUEyrD9YXZdrWlM5N/Et1s2RztOnBUQ55H6xxoVBPK68bUeatnRZhg0I+sgGeTd4olHv/7tenJfZER SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HK2PR0601MB1444; 20:A8gQlyQ6mm16+jrzrDzy0mPPyb/p8it1Ym4/t09T5a4nhhp2rcoTLNpwo115NpnhEpG9VVC7rJWoHCQwxxUR3D9iEEgHxevJ82FFlnu4z8LLrjie4nay51tGZSRYlAUNetKXrAedSaqeS1QcH3eZI0o77C0zbq3D2giD40UuG4E= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2016 23:58:25.8843 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR0601MB1444 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/sh/rcar/rsrc-card.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index c065a6d..81914ca 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -47,7 +47,6 @@ static const struct of_device_id rsrc_card_of_match[] = { }; MODULE_DEVICE_TABLE(of, rsrc_card_of_match); -#define DAI_NAME_NUM 32 struct rsrc_card_dai { unsigned int sysclk; unsigned int tx_slot_mask; @@ -55,7 +54,6 @@ struct rsrc_card_dai { int slots; int slot_width; struct clk *clk; - char dai_name[DAI_NAME_NUM]; }; #define IDX_CPU 0 @@ -163,6 +161,7 @@ static int rsrc_card_parse_links(struct device_node *np, struct rsrc_card_priv *priv, int idx, bool is_fe) { + struct device *dev = rsrc_priv_to_dev(priv); struct snd_soc_dai_link *dai_link = rsrc_priv_to_link(priv, idx); struct rsrc_card_dai *dai_props = rsrc_priv_to_props(priv, idx); struct of_phandle_args args; @@ -200,9 +199,11 @@ static int rsrc_card_parse_links(struct device_node *np, if (ret < 0) return ret; - /* set dai_name */ - snprintf(dai_props->dai_name, DAI_NAME_NUM, "fe.%s", - dai_link->cpu_dai_name); + ret = asoc_simple_card_set_dailink_name(dev, dai_link, + "fe.%s", + dai_link->cpu_dai_name); + if (ret < 0) + return ret; /* * In soc_bind_dai_link() will check cpu name after @@ -216,7 +217,6 @@ static int rsrc_card_parse_links(struct device_node *np, if (!args.args_count) dai_link->cpu_dai_name = NULL; } else { - struct device *dev = rsrc_priv_to_dev(priv); const struct rsrc_card_of_data *of_data; of_data = of_device_get_match_data(dev); @@ -234,6 +234,12 @@ static int rsrc_card_parse_links(struct device_node *np, if (ret < 0) return ret; + ret = asoc_simple_card_set_dailink_name(dev, dai_link, + "be.%s", + dai_link->codec_dai_name); + if (ret < 0) + return ret; + /* additional name prefix */ if (of_data) { priv->codec_conf.of_node = dai_link->codec_of_node; @@ -244,18 +250,12 @@ static int rsrc_card_parse_links(struct device_node *np, dai_link->codec_of_node, "audio-prefix"); } - - /* set dai_name */ - snprintf(dai_props->dai_name, DAI_NAME_NUM, "be.%s", - dai_link->codec_dai_name); } /* Simple Card assumes platform == cpu */ dai_link->platform_of_node = dai_link->cpu_of_node; dai_link->dpcm_playback = 1; dai_link->dpcm_capture = 1; - dai_link->name = dai_props->dai_name; - dai_link->stream_name = dai_props->dai_name; dai_link->ops = &rsrc_card_ops; dai_link->init = rsrc_card_dai_init; @@ -316,7 +316,7 @@ static int rsrc_card_dai_sub_link_of(struct device_node *node, return ret; dev_dbg(dev, "\t%s / %04x / %d\n", - dai_props->dai_name, + dai_link->name, dai_link->dai_fmt, dai_props->sysclk);