From patchwork Tue Oct 16 10:47:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 10643457 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B7EE13B0 for ; Tue, 16 Oct 2018 11:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56F0B29957 for ; Tue, 16 Oct 2018 11:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49AB4299B0; Tue, 16 Oct 2018 11:26:48 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham 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 44B7B29957 for ; Tue, 16 Oct 2018 11:26:46 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 86B39267544; Tue, 16 Oct 2018 12:48:46 +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 BA5F8267545; Tue, 16 Oct 2018 12:48:44 +0200 (CEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by alsa0.perex.cz (Postfix) with ESMTP id DB88226753C for ; Tue, 16 Oct 2018 12:48:42 +0200 (CEST) Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPA (Nemesis) id 0MFrWa-1gP4jd3ndO-00EvqI; Tue, 16 Oct 2018 12:48:04 +0200 Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPA (Nemesis) id 0MFrWa-1gP4jd3ndO-00EvqI; Tue, 16 Oct 2018 12:48:04 +0200 From: Marcel Ziswiler To: devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 16 Oct 2018 12:47:29 +0200 Message-Id: <20181016104730.4598-9-marcel@ziswiler.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181016104730.4598-1-marcel@ziswiler.com> References: <20181016104730.4598-1-marcel@ziswiler.com> X-Provags-ID: V03:K1:7TKYwea7pN/FWXKM2Q9kNjlXDrov0p69mKi9DQOv0CigpMCpmmc kob2L8tHU6iGejBFVZKzaRpmEAjuN0cF3PXJBWzgLRAGFevl/3Yp8BGnpdLdf7pj22J2OEh 5/nhOBF7qtXlGWqFbxQkGqFVNsx/6jo/ABLZSqPP81dNlY+iT+ozXbKt8kYHyln/7W99hyd 2UlkfMUt+qHamyyY7/fsA== X-UI-Out-Filterresults: notjunk:1;V01:K0:GG2omMcOvbQ=:pA8YgHqtjekhBq7pBHqxoI IhIFE81AouqFaqljSnIM8sdpsVACEXFrkngdFs2Ua6o5zf9XmSh9+WwnSBto/4bjmezMxCp7f bMb6s3hPGZSekx/5+h8PmuI/VF/RCtBic7+I/AGoIi7nKydE2z3IN29QAm4lvEcxOmCUvbaQr CugDw5ncPquW/L/ua8qcUTPSy84k0X76DBw7mP4J02jPZ+awU3fhPtrbjE8OMPBftwff49Mfb YiS7LIAPJGs+tvBYESOIJfqY5OX34ml/5PB/V103HbRLScbHPZrc9HSOBywZquvL6riNQFWgl y/UPdtGG1lItAyPeFIInk6bZQ6zUN5Hy7hfZ8Rz3cLM3BU3RMopsLGOVEL+1DVZR65t86OIev hr7gM8WfAe+A+kHj+7mK5cljZkTDaHOZwiT5o5iqA7xbI/8XgVvXZMgZMX+jKoDIkmSgVAmqf Spi7jhvXH4anVp1KdFptRWdPlFko5+lD26ebgEtfmvM+XS1Qlym+bpbCNyecHypHrVi+z2aXd ZAZwYc2s51/5ra8OZ6EhtRxTzcVkb14icOXI9gioOY8U30GZcAcAl0QAHYnwG4rwzjGv2RIpY EEqPDSlIXjM+N+EZ+qbyxnFHx3IrJUOtOdYhrl+/RaMEPYp/97AhJ5kKs4mZC+Wa1caahfmNi F+g13naxEgQIyGMXAq9nrFbULvTuOEsIwWc0A7UiSkLuaXa1rlpqWBMDF1b2xaaQ7e1g= Cc: alsa-devel@alsa-project.org, Kuninori Morimoto , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , Russell King - ARM Linux , Mark Brown , Thierry Reding , Jonathan Hunter Subject: [alsa-devel] [PATCH v2 8/9] ASoC: tegra_sgtl5000: fix device_node refcounting 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marcel Ziswiler Similar to the following: commit 4321723648b0 ("ASoC: tegra_alc5632: fix device_node refcounting") commit 7c5dfd549617 ("ASoC: tegra: fix device_node refcounting") Signed-off-by: Marcel Ziswiler Acked-by: Jon Hunter --- Changes in v2: New patch sound/soc/tegra/tegra_sgtl5000.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c index 45a4aa9d2a47..901457da25ec 100644 --- a/sound/soc/tegra/tegra_sgtl5000.c +++ b/sound/soc/tegra/tegra_sgtl5000.c @@ -149,14 +149,14 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Property 'nvidia,i2s-controller' missing/invalid\n"); ret = -EINVAL; - goto err; + goto err_put_codec_of_node; } tegra_sgtl5000_dai.platform_of_node = tegra_sgtl5000_dai.cpu_of_node; ret = tegra_asoc_utils_init(&machine->util_data, &pdev->dev); if (ret) - goto err; + goto err_put_cpu_of_node; ret = snd_soc_register_card(card); if (ret) { @@ -169,6 +169,13 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) err_fini_utils: tegra_asoc_utils_fini(&machine->util_data); +err_put_cpu_of_node: + of_node_put(tegra_sgtl5000_dai.cpu_of_node); + tegra_sgtl5000_dai.cpu_of_node = NULL; + tegra_sgtl5000_dai.platform_of_node = NULL; +err_put_codec_of_node: + of_node_put(tegra_sgtl5000_dai.codec_of_node); + tegra_sgtl5000_dai.codec_of_node = NULL; err: return ret; } @@ -183,6 +190,12 @@ static int tegra_sgtl5000_driver_remove(struct platform_device *pdev) tegra_asoc_utils_fini(&machine->util_data); + of_node_put(tegra_sgtl5000_dai.cpu_of_node); + tegra_sgtl5000_dai.cpu_of_node = NULL; + tegra_sgtl5000_dai.platform_of_node = NULL; + of_node_put(tegra_sgtl5000_dai.codec_of_node); + tegra_sgtl5000_dai.codec_of_node = NULL; + return ret; }