From patchwork Fri May 20 09:59:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129101 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 10EAA6048B for ; Fri, 20 May 2016 09:59:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 035AB279C4 for ; Fri, 20 May 2016 09:59:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC06327BF1; Fri, 20 May 2016 09:59:53 +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 5C3CC279C4 for ; Fri, 20 May 2016 09:59:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755186AbcETJ7x (ORCPT ); Fri, 20 May 2016 05:59:53 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:59148 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753604AbcETJ7v (ORCPT ); Fri, 20 May 2016 05:59:51 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 20 May 2016 18:59:50 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 55C6850D59; Fri, 20 May 2016 18:59:50 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 360A52806E; Fri, 20 May 2016 18:59:50 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 30ADA2806D; Fri, 20 May 2016 18:59:50 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id UAR22120; Fri, 20 May 2016 18:59:50 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211715443" Received: from mail-pu1apc01lp0022.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.22]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:59:48 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KPl5dWKNEqKcCrhfJZJ774DiS3nmwsvKvqI82XMpltY=; b=RVail0sfTkj6J1Hxx5rozTdywzOa4UL/ujRKNu4iGjWDuookUWn55U+LXM8i/ipPbKIQzZhPD37odiUX5OHCMCKt6YKgVwqiYz605puz3JepCRQpDgsOgtelGn2vCUxrtu7SniXt8T4mVR6n7XTHTb0gF5+LhEwsX1K6wcIoorE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by KL1PR06MB1703.apcprd06.prod.outlook.com (10.167.63.17) with Microsoft SMTP Server (TLS) id 15.1.497.12; Fri, 20 May 2016 09:59:46 +0000 Message-ID: <877fepqcm9.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 34/49] ASoC: rsrc-card: use asoc_simple_card_parse_dailink_name() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Liam Girdwood , Simon , In-Reply-To: <87lh35rs8w.wl%kuninori.morimoto.gx@renesas.com> References: <87lh35rs8w.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 20 May 2016 09:59:46 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR01CA0037.jpnprd01.prod.outlook.com (10.168.40.47) To KL1PR06MB1703.apcprd06.prod.outlook.com (10.167.63.17) X-MS-Office365-Filtering-Correlation-Id: 97460508-60fe-4ed3-aa44-08d380957988 X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 2:JiI/hh0pyfrd20KsIWLw1rWGIluN6SJ7MrxCuCcRhZ5FuyEVbFxscSjHC54XTGf7oe8Zaw66JDcSZCCBpb8aPAxxlicN2arLneDWV5dDecmDZwflprTPfZkF8on9OCLk8fJlDPabh97ywWlLQI96ufEzZ87x640MAlWoEiuKPMqP+WAgsD0iQ7qU6uqG4dM+; 3:OT5F/WO/+6wJLavb7usPpxzEq/szG1yI25pkg2m91Zr2wSQ5fkmSfQOPGQzWaV5Gvqc+UuEe44LERdp5vqZSNZy8kzqbNETPudSJT+mOwBv80YBv8w5ucdoLD+sseVzD X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:KL1PR06MB1703; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 25:/jdk+JlTAAShi7UtIlxwhKh3aQzo4ALoioCDhb27SBxvgWVwp1Ny7qoZQ8g/RES26dT5vJThijmNqsL0EAJK1YkNNhsSRzmTLtt3ki1rlg86vFv4XxLEyfhakHXwbdJJDolQWN+zAGykomDzEveEdCO+pKjd6SeIzFHZCofELD0gGpsW42G1edYtMM/p69ht2NAYfzSVlPray8x3D/MZqyPQBoRiOLpFnOQYVH62o9oIgnjv/LcfMU9/gra9X9sVHshKMAu5AOBPduiXhmC3PrD3Ehf9aBvQ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9/s26UAPy6e+CKv1oEv490jbXfWLcuaX45qaNIcqTY43gbAkc11qXt05V0aBMCSPcQx9WWYaQigK0aIdgUs0wBXN/9Kl2O9iVCp/Siun3k7b9ih+EKoQK4RCmAdYabbZIsDM0eZt23os10MZGreWq2z0z9m7lotvsb5nx9C4Y3YMtj5BunGrUYuepALyOwozU6JA6eJyYXwfsDmNFy2SmUPOOSEO8HZrvafmJ/RTWLoZflWGt6e8Vg4wlNUl53kvOlf8xFXIV0v89LZbRGg2NYrysseKJA== 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:KL1PR06MB1703; BCL:0; PCL:0; RULEID:; SRVR:KL1PR06MB1703; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(76176999)(54356999)(50986999)(19580395003)(19580405001)(47776003)(86362001)(66066001)(83506001)(189998001)(50466002)(6116002)(586003)(8676002)(5008740100001)(81166006)(77096005)(92566002)(5004730100002)(46406003)(2950100001)(3846002)(23726003)(4326007)(2906002)(36756003)(110136002)(53416004)(42186005)(33646002)(229853001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR06MB1703; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; KL1PR06MB1703; 23:OzrY1cFKHhF+zz68Q+CmAidvANqZF8mWkiLL/LA04iAnjzofA9e64Cp928/ZrQaZ7pZdrpgw+U1W7z+pQWyQNqW9bWywIRv9S212NWBfUlfuAO9QfTgz6p7CNEy6/jjKcQCeFEM0Wdkuu2sw5YGG6OxMdmdF2hjHIPKfcTFZFDQouk+maQ/VMXq5/B9DeuGQkMwm8n58JlHrN0iRWtufo5k3H7V9fC0WHGHx5iq+rtG9rsJV0RC2rRS8B73I3tboiJQ1zv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5oqMXgTHLV1GKeTfOGaFscNwa9C9n5NKtXf0g4FWy3i/yrkl5ZkkAD8D73AAhAJ42BpjmZWJ; 20:iKT5UZ6DQxIbnZ9CMEedPNn9vL3Te2FLLfTQ6nVpdmWqDUQqtN1+g3US38Bc0UzqGhv1i5uNpXqcYC+mPeTLefoRQqdwlRyyINq694XwzPunbGWygUi2QaxGgKFW2NMceta5gD7omerlyMChLqPPdFr9LNDyej1dhzPF2m0UX3s= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:59:46.0916 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB1703 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/sh/rcar/rsrc-card.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index 0533518..e268011 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -44,7 +44,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; @@ -52,7 +51,7 @@ struct rsrc_card_dai { int slots; int slot_width; struct clk *clk; - char dai_name[DAI_NAME_NUM]; + const char *name; }; #define IDX_CPU 0 @@ -160,6 +159,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; @@ -197,10 +197,6 @@ 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); - /* * In soc_bind_dai_link() will check cpu name after * of_node matching if dai_link has cpu_dai_name. @@ -213,7 +209,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); @@ -241,18 +236,16 @@ 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); } + ret = asoc_simple_card_parse_dailink_name(dev, dai_link); + if (ret < 0) + return ret; + /* 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; @@ -313,7 +306,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);