From patchwork Wed Jul 6 01:09:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9215311 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 0DBFB60572 for ; Wed, 6 Jul 2016 01:11:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE8122853D for ; Wed, 6 Jul 2016 01:11:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E280428549; Wed, 6 Jul 2016 01:11:10 +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=-1.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E61722853D for ; Wed, 6 Jul 2016 01:11:09 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E7AB52666F2; Wed, 6 Jul 2016 03:11:03 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 92B91266849; Wed, 6 Jul 2016 03:10:33 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 54EF8266849; Wed, 6 Jul 2016 03:10:32 +0200 (CEST) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 06E322666CF for ; Wed, 6 Jul 2016 03:09:41 +0200 (CEST) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 06 Jul 2016 10:09:40 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 9FE2044175; Wed, 6 Jul 2016 10:09:40 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 9D1BF2806F; Wed, 6 Jul 2016 10:09:40 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 952A52806E; Wed, 6 Jul 2016 10:09:40 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id LAA04131; Wed, 6 Jul 2016 10:09:40 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="214963429" Received: from mail-sg2apc01lp0245.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.245]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 06 Jul 2016 10:09:39 +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=6O+GCuQzv7T/mtTv5Qw7UEAWzfH2c3tPT9ASYYTp1eQ=; b=H/vXD7DoxcoSme0BJ/3rtsI2LD998xVKvwLHqAfnb90DiK5HP2tWhoilWzCSxr9QbY/lMsiVvOG+ercwwhIYHSwEDVAqioRLhiqsk3EjcsHVTrFex8JaBBLMqaHZZTvtCTyPLrii++GdybtD9ksZrVLqDuCSa2hDFPgWNEgnZlo= 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 KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) with Microsoft SMTP Server (TLS) id 15.1.528.16; Wed, 6 Jul 2016 01:09:37 +0000 Message-ID: <87vb0jlgt7.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown , Liam Girdwood 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:37 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0010.jpnprd01.prod.outlook.com (10.161.225.148) To KL1PR06MB1704.apcprd06.prod.outlook.com (10.167.63.18) X-MS-Office365-Filtering-Correlation-Id: 8058f8d0-fe53-4d14-0ee9-08d3a53a3388 X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 2:4K7L76dyxETYOPcv3jGIZswYT4lD92G9rqEAHqM2Sz/SfYM6qFMDC6DBycY6Ydvcc46qK4kKcAsl65qRrREMf6R5pXGr71MNcvHILxc451Y+KsXnvqtonxPzMOCQXtUBRno7AH4XIQkvh3NzX86JYvbOIK06ToOKIwBWbUSL1rgnFSVbaFJmJsoq/b0zTZqY; 3:S13z4dxeRijCRCkvLoHN0QfK9AHL+0VvJxHRLe8fKFDHiOim1trdE2qqwzPVTLh7A5KFMr9Z6m0UsdfRif6G4uwb/gPqBBW/ArClMftobG5mQBg4DSQV2I3yXHA6TCsO; 25:Qb9DYEgGlsRmQm5y2CZG19zA4i7Cgos8NBSmw5x0P/1nAMcPF5GvoftL3OqMJiLwkVtWF9bpe0CPU2GfdcD5hPS1AIRptQGc5Sn5sqE0TWH6MOj8hYoUo/+jh2zf+wBrbDbOrx8J/hy98HUnu1Da2fTtiz+mRxwXwifTxTL6Vt16wkPIiIrD5tcWUmKQH02cuC59/sNNG0msWedysd5birwB7j76/BcC2uPdRU3CTMEYo3EWX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3QVco/juYkPuna/7eqEV56cKqibXsoDivYMoe+fFmO5LiegCb89AkWvEaRA0VsIW2hfSBKBX3lsJDCak9XJhHNVD/e8zRUEnTNs4UQZHhGks5YX4XMmTcsG/ova8YDYANBFIv7RKlMhm/6Sj0tE76Zx1Ccn0qt23eRjzF2H9XkDoI+DCDH6PfALScc7KNqeLLe2De0m8SoDn8xvlKIpmzX74bkKKu7hd3VmXVp2K3TbGDcDBg2Bklqky1pBY0xSfpEVGcrfOyhyxnY2d+oDAU3kBwhK3Cvvg0RLyrPn1s0c3qSQJc96FhVIa+nZUdkVI6kLi9DNLL7r3XxuvIW0d2v1jjiKg84Lud0v1Jw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:KL1PR06MB1704; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1704; X-Forefront-PRVS: 0995196AA2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(86362001)(189998001)(23726003)(92566002)(46406003)(4001350100001)(5001770100001)(97736004)(586003)(3846002)(6116002)(2950100001)(77096005)(105586002)(36756003)(106356001)(50466002)(33646002)(229853001)(101416001)(42186005)(50986999)(76176999)(54356999)(53416004)(4326007)(2906002)(83506001)(7846002)(66066001)(305945005)(7736002)(69596002)(47776003)(8676002)(19580395003)(81156014)(81166006)(19580405001)(68736007)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1704; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR06MB1704; 23:LxAH0ouwP1nPjaF+7ppyuwDRwcLdDaoEOJct4UHi5?= =?us-ascii?Q?FoLIyEamWctEM1m1gKmmqhL+q4gIvgi0Tq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ZILMZJfFmxio8PXQn4qJXXFCFywlcZu4VN/Pm9yYy2B8yXF4PS2wew9GSFutg9d7WkDlojmiVKVtU6lyo9G2j1/EIg/2mDhMrb1DgG88YNQfTMCpcqLu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1704; 20:J4Bm2sONrQ/lE95AyobTTUBcjMRRpGlCKb/LU8GyJVC734I0RSDmf3vzX8tGG3KkrNEY1ql+t2AKkrL0rWYq8/tyK7mHXjcRoMNfEed+OOJ644CcAKfeZhjsgKYSwfa3CSM6s/49TVIiaJZAFLB22LmYD6p2AROYn+bAuxF84ZA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2016 01:09:37.3547 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1704 Cc: linux-renesas-soc@vger.kernel.org, Linux-ALSA , Simon Subject: [alsa-devel] [PATCH 3/7] ASoC: rsrc-card: use asoc_simple_card_parse_dailink_name() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto --- 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);