From patchwork Tue Aug 18 11:56:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 7031141 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76CD3C05AC for ; Tue, 18 Aug 2015 11:57:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1ACB206D6 for ; Tue, 18 Aug 2015 11:57:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 710AC20656 for ; Tue, 18 Aug 2015 11:57:53 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7175D2619BF; Tue, 18 Aug 2015 13:57:52 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6D33F261685; Tue, 18 Aug 2015 13:57:32 +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 22F8B261736; Tue, 18 Aug 2015 13:57:31 +0200 (CEST) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by alsa0.perex.cz (Postfix) with ESMTP id 8C521261507 for ; Tue, 18 Aug 2015 13:56:55 +0200 (CEST) Received: by pawq9 with SMTP id q9so34203271paw.3 for ; Tue, 18 Aug 2015 04:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=wTAA9Q2dJ2/Cu4yJA62sGNc6oqZM3Cpn2reeX4Tsle0=; b=V/EDYldrFxDtj/LSNVmk8K9Bd/LhFEbXpR+CfcjutkAJwNLL6ekXQlimy2B2GFBFWd JAkrlr/ew0LX1dQkoyeQ8N2U5LRPjvVj5ZXMowTOpQV0cA94LIwrS+EwntNbxEWRmz6o ktVYc/u8XrBh67aHsSTR4OJDfCCwtoVA7sRql7DNBASgu7W954xzCMaOm4Z7xAsKvvN1 mmYSq6JKZ0q2naG/aIXDdN4YAuWYZ4F+a4KQNCrByTjHewH4+0a8bIKbwr4lehILPTHp /zGQgK0tfmcAMkh5k02mE8NPLfOhVfm0fdE2+rf7cLv7sHYV6ptuDq0KeRr1r7MBOpOR 2c0Q== X-Received: by 10.68.243.103 with SMTP id wx7mr12590789pbc.60.1439899013797; Tue, 18 Aug 2015 04:56:53 -0700 (PDT) Received: from vaishali-Ideapad-Z570 ([150.107.241.207]) by smtp.gmail.com with ESMTPSA id y2sm17934148pdi.80.2015.08.18.04.56.51 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Aug 2015 04:56:53 -0700 (PDT) Date: Tue, 18 Aug 2015 17:26:45 +0530 From: Vaishali Thakkar To: Mark Brown Message-ID: <20150818115645.GA3345@localhost> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Alexandre Courbot , alsa-devel@alsa-project.org, Wolfram Sang , linux-kernel@vger.kernel.org, Stephen Warren , Liam Girdwood , Takashi Iwai , linux-tegra@vger.kernel.org Subject: [alsa-devel] [PATCH] Revert part of "ASoC: tegra: Convert to managed resources" 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Revert the problematic part of commit 470805eb9f31 ("ASoC: tegra: Convert to managed resources"). Before this commit, PM cleanup was performed after the component was unregistered. But returning directly will skip PM cleanup. So, to be on safe side it is better to use snd_soc_register_component instead of devm_snd_soc_register_component. Signed-off-by: Vaishali Thakkar Reviewed-by: Alexandre Courbot --- sound/soc/tegra/tegra20_spdif.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index a814da0..66237bc 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -329,9 +329,8 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) goto err_pm_disable; } - ret = devm_snd_soc_register_component(&pdev->dev, - &tegra20_spdif_component, - &tegra20_spdif_dai, 1); + ret = snd_soc_register_component(&pdev->dev, &tegra20_spdif_component, + &tegra20_spdif_dai, 1); if (ret) { dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); ret = -ENOMEM; @@ -341,11 +340,13 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev) ret = tegra_pcm_platform_register(&pdev->dev); if (ret) { dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); - return ret; + goto err_unregister_component; } return 0; +err_unregister_component: + snd_soc_unregister_component(&pdev->dev); err_suspend: if (!pm_runtime_status_suspended(&pdev->dev)) tegra20_spdif_runtime_suspend(&pdev->dev); @@ -364,6 +365,7 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev) tegra20_spdif_runtime_suspend(&pdev->dev); tegra_pcm_platform_unregister(&pdev->dev); + snd_soc_unregister_component(&pdev->dev); return 0; }