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; } From patchwork Tue Oct 16 10:47:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 10643461 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 7472F13B0 for ; Tue, 16 Oct 2018 11:26:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 639F629957 for ; Tue, 16 Oct 2018 11:26:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 577BF29981; Tue, 16 Oct 2018 11:26:49 +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 44D142998C 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 F087D2675AC; Tue, 16 Oct 2018 12:48:54 +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 90F1B2675AC; Tue, 16 Oct 2018 12:48:52 +0200 (CEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.197]) by alsa0.perex.cz (Postfix) with ESMTP id 38D4026759E for ; Tue, 16 Oct 2018 12:48:49 +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 0LzIe7-1fYL5j3C3V-014Pxx; Tue, 16 Oct 2018 12:48:07 +0200 Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus002 [74.208.5.2]) with ESMTPA (Nemesis) id 0LzIe7-1fYL5j3C3V-014Pxx; Tue, 16 Oct 2018 12:48:07 +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:30 +0200 Message-Id: <20181016104730.4598-10-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:MIunh8M8gL/uGufQy84VMDRM78SzrUFY0quxDQdowA0Wsci8h+a 38ubtDDQBcvaJz9+ceurnZK6HKW9+1Xlv19w6emZe1YA5SU3lW01AKbyETAnabzStDOX0Dh a5tV+xrPwQi7Uk/kNDzJDJq2PJro4mjdXM8GmdR6RZ4tpjKYSE0+/N+zQ6vE8tnxfA3ia4C Zt9JlDlWQiofVpm5pmW1A== X-UI-Out-Filterresults: notjunk:1;V01:K0:C3uMcV8zHwI=:3lyw1gJjsmSoDHl2tc44Ea nKE3+a8aWKIOFCOYqfNa3a950WF/j9nEi2NE0gjtd0tZuWwaYJ9drKZ1w/4pJ0yiD1U0WBMEW 83ZKjeD1UpNeAPRagy6rfwzdndoy+9HoyNuTH5tu9GZidP68uxEl4boql4DTN8c8wK+kwDOME GHpMT/ipAn5fq19FwDYHNypxdTIijYRdQ/UwnwQcHhG8cJOjlHwq8dbaYutGtJu6Yqm726Pcz U0gX/6qFIDWwc1FqYFkESge6oZpf/mUgWpXqgP0/0U9mrMpLdspSQ3hEG7uBmhucpC5SQXtft Mi/ADhNi8OqVu88Vui1/ru2ik4Z8nmolA+SQQA+e9bEZB+WT/ehE+VCm50Ov52YryvjeG7f0K 9fKFb0DP1KQhZlJp2BV4SQCFMKxoCAnHbx9BOhqRV+t/YECYYVIlTNcGnGG369NetdOs2VpKi Vr0oTxYeRodJ42dEo4m0i7abQVzuzn2Wf11L2a/vwSRV5oUoGLFGXByO1A2gNZydTPF26NH3P E/y6541JZrz0+vaOdApWUWhLOxnP9fmS2+Ub4Gdr7x9kyh+IWiWqBE3RQcG9VTMwlM5ZPFQGX 2KQTdTkfN+Z+X74vi/FvvlYzqQZ9Ca118B5Kb69sPMv8h/eMXyACgld8l6COUzY/fYECChcd5 9hnVG9Kfh1707a9JsCH1UwHq7i8zEhpC1JRPlLmHd803Q/YQMYwqQF37KoIAqPmS74mU= 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 9/9] ASoC: tegra_sgtl5000: fix platform name vs. of_node assignement 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 This fixes the following error as seen post commit daecf46ee0e5 ("ASoC: soc-core: use snd_soc_dai_link_component for platform"): tegra-snd-sgtl5000 sound: ASoC: Both platform name/of_node are set for sgtl5000 tegra-snd-sgtl5000 sound: ASoC: failed to init link sgtl5000 tegra-snd-sgtl5000 sound: snd_soc_register_card failed (-22) tegra-snd-sgtl5000: probe of sound failed with error -22 Signed-off-by: Marcel Ziswiler --- Changes in v2: New patch sound/soc/tegra/tegra_sgtl5000.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c index 901457da25ec..eb702925cac3 100644 --- a/sound/soc/tegra/tegra_sgtl5000.c +++ b/sound/soc/tegra/tegra_sgtl5000.c @@ -168,6 +168,11 @@ static int tegra_sgtl5000_driver_probe(struct platform_device *pdev) return 0; err_fini_utils: + if (tegra_sgtl5000_dai.platform) { + devm_kfree(&pdev->dev, tegra_sgtl5000_dai.platform); + tegra_sgtl5000_dai.platform = NULL; + } + tegra_asoc_utils_fini(&machine->util_data); err_put_cpu_of_node: of_node_put(tegra_sgtl5000_dai.cpu_of_node);