From patchwork Fri May 20 09:54:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129079 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 C1B096048B for ; Fri, 20 May 2016 09:54:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B47171FF6C for ; Fri, 20 May 2016 09:54:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7DBE2793B; Fri, 20 May 2016 09:54:39 +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 151291FF6C for ; Fri, 20 May 2016 09:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753025AbcETJyi (ORCPT ); Fri, 20 May 2016 05:54:38 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:15681 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752892AbcETJyh (ORCPT ); Fri, 20 May 2016 05:54:37 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 20 May 2016 18:54:36 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 47E8250A01; Fri, 20 May 2016 18:54:36 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 2B0CF18070; Fri, 20 May 2016 18:54:36 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 22DD51800A; Fri, 20 May 2016 18:54:36 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id UAF03572; Fri, 20 May 2016 18:54:36 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211273182" Received: from mail-sg2apc01lp0246.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.246]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:54:34 +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=dY29dfUJX5BRnYzOzdtUb4Bc59tEvkuC90rvetdYm9E=; b=dk25U/5CXLzKGXHsypVBkS9KMC94A/Xv3MM8g9pn8WoEDN4OOw02IB/e20Ln3kOvQmMgZSnTmx4I7waxBaIz72yvL9he0tZwXus5Jcov3ThV9oKXG9NrMTt9MX5TqrVSInRzJEMqiPktgJ2j02Tjtl/wTxPohiPPLKhip9/JhTc= 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 PS1PR06MB1706.apcprd06.prod.outlook.com (10.167.53.16) with Microsoft SMTP Server (TLS) id 15.1.501.7; Fri, 20 May 2016 09:54:33 +0000 Message-ID: <87lh35qcuz.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 24/49] ASoC: simple-card: use asoc_simple_card_parse_card_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:54:33 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0041.jpnprd01.prod.outlook.com (10.164.162.23) To PS1PR06MB1706.apcprd06.prod.outlook.com (10.167.53.16) X-MS-Office365-Filtering-Correlation-Id: 50c2007a-b758-4ecf-8bc6-08d38094bee3 X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1706; 2:DTGgbxb37EyGxtXNgwi4q4/JWZtMbHMVNYVyeFM8P+g5E18FVEAr+IQK0rXEvyW8z4H9FTTYvQag8dUeTJaT1alPShesQB3uwpdS6jUDQrtPNAve0iBe1gsG2u2LHbXjzVAlKwIF2QCOZGQ2JZA5j7AbU0gzO/sQUdCczFU3i8BCjWEqbJaCjviqAAgV+fHy; 3:k5t77YV1MOsxHm8y02/UVKvkEMopnr3DkPuJekyBRO4/ptWb6CulZV2r+L+3+QJunLUo3TPSMgIauLxvqnW2YmhC6N1vYVVNsj87/y2eta1Dp8BNVqw47Ag/pPWsRMtE; 25:6nhXKk4qbwCO9ug++JZkgCHzUlB2kZeHvPYpdcHX6wGAiQXhlMPlHvkTCWsXgvsFiKzyfNCsoAnFWtjyBkffiSdYz67JVepTMzg3q1+QfPpUrVJN9lHIS8lqCMRoMq9fT3AOBQTMPC35JyYkvMrjZypyQ56PEf1rv8hQrp3aVVHn0lSUKdez6eCncWI4k3I9jW80cSqSDJZm4I2kIobmPYdBHPDHohlL/74y+DtO635Vmfr6pAdgoGzfae+e34d8TJriwYL9CI5JYukrzzfFivrGE8uxeeCnZm5oD0I7UVPSJEbbGvuVYVUQ/REOGuaAHYh/1n4RIfG/vC0hAKKqsORFK2vBOpmlFnO/UDd9sFlz/Bqh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qA9RGQpDxsQ== 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)(10201501046)(3002001)(6055026); SRVR:PS1PR06MB1706; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1706; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(110136002)(189998001)(81166006)(8676002)(50986999)(76176999)(54356999)(86362001)(2950100001)(42186005)(4326007)(77096005)(5004730100002)(2906002)(23726003)(83506001)(3846002)(66066001)(6116002)(19580395003)(19580405001)(5008740100001)(92566002)(50466002)(47776003)(46406003)(36756003)(586003)(53416004)(33646002)(229853001)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1706; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1706; 23:LmHyz7+0553oTK0eYzi6xl7ji5CP/JnZA+UOrGw1Szyp1y7r+5chdV5c4u5VMdn1xZNGO70Lc9UadyjZAVF5IqbXACxDExDBRnXn9RfLJA7QBrzcBm1TSGVWfQmzHs72Xq0Ko+9Py5FuLO7/oHwwIT1QU0xVR7No3JHoucBpyadukSPAcRx+pBXNVyOx4PO5HGxndFfqrsEZiWpDRa7KQxYTnh8+WaFw6Xhx8hJMCninZf0uEAUcFrR6InQ0MnMXbfph4SZzwbZzBC3WpX+9sJTHWhiKcY8vqUEH9iZ4RY3Rpua5M/Nyw57x/K7WWlXyoLx4Z32jpf2TZBQayoTQHjyN978KPThc01dan+2NJ7/poAp5u52d7RnsSs6UaBGcF04vw7bzXyWPWtt7TNxnDsDZ9ZJHxSvm68ViFSDvfWA8XYQLqDD70M3zZ8UwM7bg++ePLSD2/voUD+2Mc2Xg3h1hO5VPTX4FYBlbRceL1EDomtUhx4UdkJHJXzGW3xdFBJjtyYxpyYAHL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pamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:54:33.0782 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1706 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/generic/simple-card.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 56a8938..a85245c 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -40,6 +40,7 @@ struct simple_card_data { #define DAI "sound-dai" #define CELL "#sound-dai-cells" +#define PREFIX "simple-audio-card," static int asoc_simple_card_startup(struct snd_pcm_substream *substream) { @@ -233,7 +234,7 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, /* For single DAI link & old style of DT node */ if (is_top_level_node) - prefix = "simple-audio-card,"; + prefix = PREFIX; snprintf(prop, sizeof(prop), "%scpu", prefix); cpu = of_get_child_by_name(node, prop); @@ -344,6 +345,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, struct simple_card_data *priv) { struct device *dev = simple_priv_to_dev(priv); + struct snd_soc_card *card = &priv->snd_card; enum of_gpio_flags flags; u32 val; int ret; @@ -351,9 +353,6 @@ static int asoc_simple_card_parse_of(struct device_node *node, if (!node) return -EINVAL; - /* Parse the card name from DT */ - snd_soc_of_parse_card_name(&priv->snd_card, "simple-audio-card,name"); - /* The off-codec widgets */ if (of_property_read_bool(node, "simple-audio-card,widgets")) { ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card, @@ -375,9 +374,6 @@ static int asoc_simple_card_parse_of(struct device_node *node, if (ret == 0) priv->mclk_fs = val; - dev_dbg(dev, "New simple-card: %s\n", priv->snd_card.name ? - priv->snd_card.name : ""); - /* Single/Muti DAI link(s) & New style of DT node */ if (of_get_child_by_name(node, "simple-audio-card,dai-link")) { struct device_node *np = NULL; @@ -412,8 +408,9 @@ static int asoc_simple_card_parse_of(struct device_node *node, if (priv->gpio_mic_det == -EPROBE_DEFER) return -EPROBE_DEFER; - if (!priv->snd_card.name) - priv->snd_card.name = priv->snd_card.dai_link->name; + ret = asoc_simple_card_parse_card_name(card, PREFIX); + if (ret) + return ret; return 0; }