From patchwork Mon Jun 15 06:22:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6606281 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CCCD89F399 for ; Mon, 15 Jun 2015 06:23:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCF5520569 for ; Mon, 15 Jun 2015 06:23:55 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 980BA20462 for ; Mon, 15 Jun 2015 06:23:54 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 98A882614EE; Mon, 15 Jun 2015 08:23:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5C24826085B; Mon, 15 Jun 2015 08:23:00 +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 22A9626085B; Mon, 15 Jun 2015 08:22:59 +0200 (CEST) Received: from relmlie1.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa0.perex.cz (Postfix) with ESMTP id 85DCE26128A for ; Mon, 15 Jun 2015 08:22:08 +0200 (CEST) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie1.idc.renesas.com with ESMTP; 15 Jun 2015 15:22:06 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 05A2D4530F; Mon, 15 Jun 2015 15:22:07 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id EBF218002D; Mon, 15 Jun 2015 15:22:06 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id EA63F8002F; Mon, 15 Jun 2015 15:22:06 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id RAF05033; Mon, 15 Jun 2015 15:22:06 +0900 X-IronPort-AV: E=Sophos;i="5.13,616,1427727600"; d="scan'";a="189472380" Received: from mail-hk1lp0118.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.118]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 15 Jun 2015 15:22:06 +0900 Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Received: from morimoto-PC.renesas.com (211.11.155.132) by HKNPR06MB306.apcprd06.prod.outlook.com (10.141.37.22) with Microsoft SMTP Server (TLS) id 15.1.190.14; Mon, 15 Jun 2015 06:22:05 +0000 Message-ID: <87oakhv6h0.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown In-Reply-To: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> References: <87twu9v6kn.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Mon, 15 Jun 2015 06:22:05 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: OS2PR01CA0038.jpnprd01.prod.outlook.com (25.164.161.148) To HKNPR06MB306.apcprd06.prod.outlook.com (10.141.37.22) X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB306; 2:e6xQgACW9yLm2N1QNaLBicAf4VhjZ5lVfBfiIidS2PV2FbtY1yrF1t3LSoYBsCU0; 2:VFn3ohzjws5sZNOkPbXguwjGWfTxwRKRqz0otd2laFrkc7iBd69JWhCu6uJM2RVzsgsF6gchFFsYgGh5FdWIh65Qp4cz1f3+1CVmEp1saU+CShZj+QSUNft8ZapFnZfnrF7aCKl5X0CGObyVlH3zqg==; 6:QUSb/TgjxsS3doKXI6eMgkZGb4su2/W4gcS6F0RJF9KguIGJR1BR77gansrj3vz5USSPGR6JcNn8/IniabzUxDh452Y+rGqxZZ7+pSqbePw4qGNIgMYrTE3C9VyKf0TUBpus89JjBEXTEIiUZxajO6chK1FXIzXrH4msRDERWV/zWql8hTyp1ui24XkAmY/kNd1sE3nFLdxeKWVvdV/fL3K0e9dg5RD059QFIrLzZwOlhCfikG7rlG7316/xxQTvcyommMwc5xcepPSTQ2CGx81u9g9LyspLK4BDL2QM2MPeiecTJknfgF2JrmEokm4tki/QTDp9+XNTxA/7jdrMASK+3QKw6rBfE7o0s3MZDIDHjza0Ou9qihTRhv8FCPrJ55hcnXUrDukXjhFkHTbH8016eNZoT9sAf/InM9+8H07Y1EusyTWhSca1jQ3lA5j/CxH0QVhvc0MVuevIQLxjxuuxEvoM42w2PvVVcRRBHDYMUcmGUEI4zmwGhgEnBlQV X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB306; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(520003)(5005006)(3002001); SRVR:HKNPR06MB306; BCL:0; PCL:0; RULEID:; SRVR:HKNPR06MB306; X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB306; 3:YJjKEE4jyko6KDQtKSPRQmgGvqwgxm5w2qrRCBkXP/P+3GO7wmcOMA/mPjJH6idax1tM+t5Z/dXDvb7ctP2hAcTc+44WmoTWylPsdRku/DlE/oeMBqw1TKca3n8UsAfBf6atGuFufREr9e1dRfS8T4MNBmsih5qLQ3iMDy/abvwMopu8uEkeQK4eSBFN7Kz/1CpsDA55MKiQ3hv0IxDHm6+rJ2fqBnlPO4kogDk/1f30irO1L1T1zMx3/hnS/GMqBcY/r+0SyBAWXfj194rePw4iK7PAJYpXAmMX8lwJDPPfg1BaSGt7009E1PnmYptJ X-Forefront-PRVS: 0608DEDB67 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(19580405001)(19580395003)(87976001)(50466002)(86362001)(4001350100001)(2950100001)(110136002)(77096005)(5001960100002)(76176999)(54356999)(189998001)(62966003)(42186005)(77156002)(5001920100001)(92566002)(83506001)(229853001)(46102003)(66066001)(53416004)(50986999)(36756003)(33646002)(40100003)(122386002)(47776003)(23726002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB306; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:; X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB306; 9:wWCJKnvxDQ8qTSIgUJ0F+2X0sGNmVEdX+OM8s4H1wGQGI9vUVHp+H0ntrnHft5/3Gw0t96NnwofVi8Zs6566181/lbcou5wiVyEw6x7lrMdWAQ6Q/gq5ySqlVKvxoOqiCpcuIvSlmmdwb+gDfsZGc+MHl//wNH8WuiISTTw1Huq5IN9B3DKf/4MWUeyh/QG6DjU600BC8BJi5sewhOVy4rkGq2LdifjDYB3h00434+AHDCvzsiQGYOnpi9y8ApmKCk1ietzKXUwxFOEf2iq25KGXmoeLTIxWv6X5MWF+Bi20JTg2WW0OnWZFa+IWRUeun31ydY1CWA+avXppWIIKWb3VK5Bsy2BhYWyX9Rbo+qiFWYZ3GW56TIk1gXro4R7iyq8hynlMlOzOynk2skGRnbHsjdP7Ld56s2+kNr/e/VqeG2jiV1UBC/5PQGJnhzxPDRDDxhnBn/IaATOz61T1/roEqyQyU4LMw0siBDMEjlcjBMKKpObSvyFPASVghplD3vF8ENttNlh4T5vVfm8kI7NVgkjp3rKvOAsS86/2bhdMv/6ndB/qQnOqMB97ZTjebRZi+uizG2RglHD9yK4Ve6k6JZo/d/6edGq9/eTs/jMWBj/8KaZQx2mgQG3Skw/diMIX/39uZUmEn+rSyzQkcstAi65AmgASS5tFteTmavE6iwQpY6K6diUVUg4J9xYfZtAllo7bqbGUkC3TMRJDNqp5OUNY2dKV5D/T8+FZ20YWxzWqM0SuPdpS0WcSLcDZwZy6YCoti1zrLPZYg/hetiLCEn0FXDnIAvDCqIJib1iY4MQ6GQ5cZWve3Wkepej6XfBOCrYzKWCMlqSFcdYuIQwNM4Zb67+wmMoQ/BwNYAA= X-Microsoft-Exchange-Diagnostics: 1; HKNPR06MB306; 3:HF+ANYvynniIaTBDQowCUotdx8qOQxTU4gvEXWvnb1S1Sc/IOvtOSR9j+y67kcpD+Wmor+oopshQmm/CHCH1AucALiMnrKd1s6DfFg0bM0bYMxhKflhCuu5Paed8tKeNo9Vrc0C9lljbblH6yZ2WmQ==; 10:xFBjgcvfSjMBH3iOj03OpzK4drd/tEUppLddSt9T73yi4ic42eC31VVpOAR3cnSPmoTzHtCY7ItgXSNYCW7H1i2AEzM8t9GtRDdLxKhOBe4=; 6:s0Ds1XZXwfXlexRuA55YNsWWgfgoAiObwihBNs5h7Gfoy5QOttbOKwcLYQ1h6uNnGbmxJCdQOpbq1RejJC8h0eaoUlMyQq6Anfhak4i5yIXCoAc8wgpiI/4NimjhNFmcGXs4BmTrl0BHpkt7ydkKcg== X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2015 06:22:05.1442 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKNPR06MB306 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 04/21] ASoC: rsrc-card: tidyup priv->snd_card setup timing 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 Tested-by: Keita Kobayashi --- sound/soc/sh/rcar/rsrc-card.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sound/soc/sh/rcar/rsrc-card.c b/sound/soc/sh/rcar/rsrc-card.c index 9a1926f..cdd005b 100644 --- a/sound/soc/sh/rcar/rsrc-card.c +++ b/sound/soc/sh/rcar/rsrc-card.c @@ -391,9 +391,9 @@ dai_link_of_err: } static int rsrc_card_parse_of(struct device_node *node, - struct rsrc_card_priv *priv) + struct rsrc_card_priv *priv, + struct device *dev) { - struct device *dev = rsrc_priv_to_dev(priv); const struct rsrc_card_of_data *of_data = rsrc_dev_to_of_data(dev); int ret; int i; @@ -404,7 +404,13 @@ static int rsrc_card_parse_of(struct device_node *node, /* Parse the card name from DT */ snd_soc_of_parse_card_name(&priv->snd_card, "card-name"); - /* DAPM routes */ + /* Init snd_soc_card */ + priv->snd_card.owner = THIS_MODULE; + priv->snd_card.dev = dev; + priv->snd_card.dai_link = priv->dai_link; + priv->snd_card.num_links = RSRC_FB_NUM; + priv->snd_card.codec_conf = &priv->codec_conf; + priv->snd_card.num_configs = 1; priv->snd_card.of_dapm_routes = of_data->routes; priv->snd_card.num_of_dapm_routes = of_data->num_routes; @@ -446,7 +452,6 @@ static int rsrc_card_unref(struct snd_soc_card *card) static int rsrc_card_probe(struct platform_device *pdev) { struct rsrc_card_priv *priv; - struct snd_soc_dai_link *dai_link; struct device_node *np = pdev->dev.of_node; struct device *dev = &pdev->dev; int ret; @@ -456,16 +461,7 @@ static int rsrc_card_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - /* Init snd_soc_card */ - priv->snd_card.owner = THIS_MODULE; - priv->snd_card.dev = dev; - dai_link = priv->dai_link; - priv->snd_card.dai_link = dai_link; - priv->snd_card.num_links = RSRC_FB_NUM; - priv->snd_card.codec_conf = &priv->codec_conf; - priv->snd_card.num_configs = 1; - - ret = rsrc_card_parse_of(np, priv); + ret = rsrc_card_parse_of(np, priv, dev); if (ret < 0) { if (ret != -EPROBE_DEFER) dev_err(dev, "parse error %d\n", ret);