From patchwork Thu Oct 18 11:18:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Ziswiler X-Patchwork-Id: 10647029 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 F418917DE for ; Thu, 18 Oct 2018 11:19:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5BD6285FC for ; Thu, 18 Oct 2018 11:19:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D799E2860C; Thu, 18 Oct 2018 11:19:23 +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 30358285E2 for ; Thu, 18 Oct 2018 11:19:23 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A2F882678F2; Thu, 18 Oct 2018 13:19:08 +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 9FA702675C7; Thu, 18 Oct 2018 13:19:04 +0200 (CEST) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by alsa0.perex.cz (Postfix) with ESMTP id 9E9932675B5 for ; Thu, 18 Oct 2018 13:19:02 +0200 (CEST) Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPA (Nemesis) id 0MacbH-1ftV8t3ldp-00K7TE; Thu, 18 Oct 2018 13:18:43 +0200 Received: from localhost.localdomain.toradex.int ([46.140.72.82]) by mrelay.perfora.net (mreueus001 [74.208.5.2]) with ESMTPA (Nemesis) id 0MacbH-1ftV8t3ldp-00K7TE; Thu, 18 Oct 2018 13:18:43 +0200 From: Marcel Ziswiler To: alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 18 Oct 2018 13:18:27 +0200 Message-Id: <20181018111829.27056-2-marcel@ziswiler.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181018111829.27056-1-marcel@ziswiler.com> References: <20181018111829.27056-1-marcel@ziswiler.com> X-Provags-ID: V03:K1:h/RwB9KJSeshyjTp77xr2mPVM7dco829n86Dq8wxKpnlzn2pE4v DbDs+3TIMI7qUrUIrJtQHkIiZxptkRySzFRLkHq8ivFIVWouxpNIYeOgJCkAoAgcfagbjh1 UVdKlJmjMVFeO+Bx+1Vhh1WytoxHYS06R5fxKxAFa8nef5sf5IKJHMw2PP+k53SOoFULebA GY10TFDx7bJ1vCcea684g== X-UI-Out-Filterresults: notjunk:1;V01:K0:jA1xLb7G+uQ=:FUsTvKVxL4HmK1TbnmKvX2 ts4Qvi2FKGGsifaGKNcMDHkmxwTfRrvwX4yW3Hhu8HJh+kJG50ijETD8hsQ53yMD+Ng9deLMj Zrnpg6FGmngJJQMEJU/jbkjm/QaNk4w+RqILNu51f0nqLjyn2BXRyVI7Dl2kilh0zhCWgGrwy KHZcAYG7EPb7JPF/HINqn6aW673eS6ptCI9VsjmamMYDjC6uQhxoxwRldXoZTtKJCg1zzZ/5X vcHsl1v5KPK2DWM+pYZjZxQT5Vwrrrc6i1hIy1tMFqXx/aD+MGb29eIhW/bxXeudHv7KAXPbF etoH1taDEg9fZg4jHqlsuV5dww6eXoCpkNHbAnxGGvXvC/hHVZB83F+1cDODTyR8TgzNeBTaY NIRtoSYA/R/nrnvOCQH4UQDqaHg1wm/ZS2ImkwcfCrQgOZgNF/pqJc4odlEwe8ZiZx/wnNTfb S96OGMAYIITlcq5a/LOn0MY45H7W/Od2MVobVboZ9K0FYavdSadYS9egoRNeUGdOL7WMFaTOC KTZlUgXvK+EOJqi7bb+x3QxL++fYVFcwM3sDLazCwA7DuiJk03oKhILkkT5tHdXC0eakgweXc mJYiY2bM53SjRraFAgUvYsKRcE4LkXbCm7NyM3QVwf6yCQxCUiIl/jcuXDleAjT1Wmx8DjO8d 6WY/3UxPiKry2TU6CGaGrjc8g6QxP295XBpX8ETyg03o04CHopYzmYgWfCXXus3wbSBw= Cc: Kuninori Morimoto , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , Jonathan Hunter , Mark Brown , Thierry Reding Subject: [alsa-devel] [PATCH v1 1/3] 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 v1: None 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; }