From patchwork Fri May 20 09:50:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9129063 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 C040F60762 for ; Fri, 20 May 2016 09:50:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFE00208C2 for ; Fri, 20 May 2016 09:50:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1F46279C4; Fri, 20 May 2016 09:50:33 +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 10E8C208C2 for ; Fri, 20 May 2016 09:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932763AbcETJuc (ORCPT ); Fri, 20 May 2016 05:50:32 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:60086 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932604AbcETJuc (ORCPT ); Fri, 20 May 2016 05:50:32 -0400 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 20 May 2016 18:50:30 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 90658507EA; Fri, 20 May 2016 18:50:30 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 6B1E028070; Fri, 20 May 2016 18:50:30 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 698632806F; Fri, 20 May 2016 18:50:30 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id UAK18564; Fri, 20 May 2016 18:50:30 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="211713953" Received: from mail-pu1apc01lp0017.outbound.protection.outlook.com (HELO APC01-PU1-obe.outbound.protection.outlook.com) ([65.55.88.17]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 May 2016 18:50:29 +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=4lSvJN+r1yXJf1Wds0fS5vH3zIMMQ+iS/zAtvfUkv9w=; b=Ga+ssqkWNKzaGqOFFXyX6OxByTHBQ4uPneKWuKhmp8UwSzW+t67HR5ejqoPYen61UbCTG4hk4RRVSLDx3he9/SB1enw4aGFQhfAY0+v1pPQ5x23nnvpirvhRTjhhNQqFEtCXR47blT0e4ZHLxSwgMOm3R+9uUSekpOlBH+65UJY= 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 PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) with Microsoft SMTP Server (TLS) id 15.1.501.7; Fri, 20 May 2016 09:50:28 +0000 Message-ID: <87twhtqd1q.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 19/49] ASoC: simple-card-core: add asoc_simple_card_clean_reference() 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:50:28 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: TYXPR0101CA0011.jpnprd01.prod.outlook.com (10.168.40.149) To PS1PR06MB1705.apcprd06.prod.outlook.com (10.167.53.15) X-MS-Office365-Filtering-Correlation-Id: e5ce0cd8-eeb5-478d-0657-08d380942ceb X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 2:2tXkyG+R8Hf6UzC8WHZqucaP22QILBZwzJZaTWqga8s7lwwHSWPGOHxHpg8f/33cqzp18eV0xnpXkCUWwUZFwofPQKPGEf29qy6sf71tz7XK/pVxofsByP7h7TYy81KfaFPFctq1Tovv8CdteLAh9cktQedR0RFeNV0TlD3GK9iItmk9lO50XtOPSY3EMyem; 3:zmi9dTcA9QCVqXwEdkn9u9IdX3sqd3ch16KsRfoXGHD6cxITnGN76EBG128ZkgQPEGzinrtudV3Yu5KNen2JHLsye1CKE5bal2VB6NfR3lyR1EApUK3BqSAFkI+c9fSm; 25:WFhFHG90PaQlKHJQEbLcKbwiDsWAGew7Q/WhWBHcABqPyb0Nk6tEaTrkTwQPmjWpFPcElTqzdaKr9TXn+b1do/B2OUkX2cSs34vt/6gJiEktdBFA6zvf5GBYgn5SYYTil+EzjpOOXytv/kL9h4QnrkmPQY5GpFfK5Mrx6znKzziJ0kUuON4ae1Oe+HsFjCXYY3qEqBpj8/9uLcRHyHsiPJcryv9H6Yn26ShGu584u8UOWaaB9FOvLYHgM9cdSOqxsfcY6F8O5fj1byTCkUAAhJvP12VZnt90wz7ZcnJmtWhMUJ8E7sSX6gYZUwY1GjcgpF3cTULRsJjmqVUdrdeOqDaOWPzkHOot47U9IBgw6vhKWDVezjOuuxE10bkHXyDkwInc5nPTGsYFzkg1G1XQnkmgsQk7eZ6QZ/mMW9/ckWw= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR06MB1705; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 20:i2Suh/H5qnc+Ojol0JGShzAMJxCrws8eokLUOM6lh20b5IcpXgXgqEpXQWhG3nBdPZvuuchmTw/6kcTuk9HCijuny0Dor/LdhEwKcADCV/JLAOX4ce+znEh82Tfy6NZBBGNuZoT6uYvrDuDmuvilwlccsm/HRc1t0XQArPyK/zeyBFmx9mZ3v1H4JQa9HksKR2tE6REmiEY/3DAgJWlqZt0SPZ8vVElLvrolwD09yEWkmgvaLvQUVqFmoa2kSp8kUf02QG34PqorDJ5D1ejUGadwViAkVEKUMQ0T05rSoP9CpK17uZHN4QWwiR5Q8C8B9ReytyJhuUnqOl2Hc9L71HjqjoH/Z0OOvWuJBWyhKxobcVi2fhlK2UNg5ASOxqJxsECT3qyLJmj089nAZ03Ad4+65dVy0JYiBntP8UBOmky4Wrle6R72BEeTt107cNOB3XuU0THc9fIVVmHVOCLlfYiLqco1grO0r9EoBLxsMqa5GFOp6xL2OsQktyR+9GqI; 4:5TwtPwpnq6tOfevulHWqYSATVmEci7vewPbi7qe0701lS1a+RcVe4M8MwJTaiWmzOXfbFVdCrAvBuRO69Wj5JNkEhgoro8nnyLOWrSKNXzJVZUEEpCjjAIokUtflAEK2fTD4LGiSYrnWfi6LEtpph3Tl7nm/Atn72DfQp0Afr/Zuwwl1dN0cRqo849ijDrRPV0/4b+9t4D9WIWZTl1jVGci8Vkw667vuhb9ns9HpglqCvg8OnmeK6nkJg2Y4KNr96bDOJOjF1ptgjILTGRLormXmwDLvpHWa7vFdaPNt+zHrGEPe3x8lF4qx/Odw5h0OTWnuv7rqDcd2C8HRb0JtKkJ82K9GADc7byN4fvMUfZ8LhCIBQo73OwpJXefltJ8nmkurBCXuTlOs96jldbl0wg== 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:PS1PR06MB1705; BCL:0; PCL:0; RULEID:; SRVR:PS1PR06MB1705; X-Forefront-PRVS: 09480768F8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(46406003)(4326007)(5004730100002)(5008740100001)(229853001)(83506001)(33646002)(23726003)(2906002)(3846002)(6116002)(50466002)(586003)(230783001)(66066001)(47776003)(36756003)(2950100001)(81166006)(53416004)(8676002)(77096005)(42186005)(110136002)(189998001)(92566002)(86362001)(19580405001)(19580395003)(54356999)(76176999)(50986999)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR06MB1705; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; PS1PR06MB1705; 23:sCtTGzLD0AbTeSSUlJdoXQ3F5/sK5n4LQmHzHWNCFDcuNy0bHmCumNu8e2CYIZuI9spX40rbd4FNH5tdS9yf5+3kRKZZ3BtCGkG5w9jkksbXIRL9SgOIEW2J26tX3FPVPzyP9Qp9Gf0bhzTQdVSmt83jMxRFg1GFDL4BZCofTsuLSFX6vLRxV8ykYlvjaw1Tro+77lWR5qDGBoSegWddfUUXcKCsWQzLuXJ8D6kMsGbIxANiiXvB4rKOpGpIvUCnr5Z/3WNNOh35tHHtyLCuLcizrnJhCU8ETx/56bfDAFYAVg6ji6HwOYUaK+7oZVeRO1T0GuurFlRzH9liPDJtW2KBIkrxOi59vHYS+CCgCIvKaBah7Kxr6iDOtI1ZlU0vY/42VF+ivXNOnjOE5YPZqjhTZnFCqfuDPcUJ2QOFYV3OgH4bJVecAJQoGQmApRTSQc8if+DzF1H27bKjQQmjnQGyEtwiEIKaqJH3SIc25ia5+htYXXF4ZpwgAMzPhaV8rnIGXvAVtJScNCgb2nc6pcDGSyGkO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ikcrOZ4s= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2016 09:50:28.2737 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR06MB1705 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 simple-card needs to decrease the reference count of the device nodes. This patch makes this method simple style standard. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_core.h | 2 ++ sound/soc/generic/simple-card-core.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/sound/simple_card_core.h b/include/sound/simple_card_core.h index cd69d52..10892ae 100644 --- a/include/sound/simple_card_core.h +++ b/include/sound/simple_card_core.h @@ -101,4 +101,6 @@ int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link); int asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, int is_single_links); +int asoc_simple_card_clean_reference(struct snd_soc_card *card); + #endif /* __SIMPLE_CARD_CORE_H */ diff --git a/sound/soc/generic/simple-card-core.c b/sound/soc/generic/simple-card-core.c index bcc7826..f1d1f9d 100644 --- a/sound/soc/generic/simple-card-core.c +++ b/sound/soc/generic/simple-card-core.c @@ -392,3 +392,18 @@ int asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link, return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_canonicalize_cpu); + +int asoc_simple_card_clean_reference(struct snd_soc_card *card) +{ + struct snd_soc_dai_link *dai_link; + int num_links; + + for (num_links = 0, dai_link = card->dai_link; + num_links < card->num_links; + num_links++, dai_link++) { + of_node_put(dai_link->cpu_of_node); + of_node_put(dai_link->codec_of_node); + } + return 0; +} +EXPORT_SYMBOL_GPL(asoc_simple_card_clean_reference);