From patchwork Sat Aug 15 01:51:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 7019951 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 C7962C05AC for ; Sat, 15 Aug 2015 01:51:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 039E12069D for ; Sat, 15 Aug 2015 01:51:26 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 955B92050E for ; Sat, 15 Aug 2015 01:51:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 219BF2664AD; Sat, 15 Aug 2015 03:51:23 +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 34B9F266323; Sat, 15 Aug 2015 03:51:16 +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 04EA026644C; Sat, 15 Aug 2015 03:51:14 +0200 (CEST) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by alsa0.perex.cz (Postfix) with ESMTP id 965E926627C for ; Sat, 15 Aug 2015 03:51:06 +0200 (CEST) Received: by pacrr5 with SMTP id rr5so70971254pac.3 for ; Fri, 14 Aug 2015 18:51:05 -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=qGfRBupTzaOpccxR5oYzVsb8czC6H6h3PUA4slGYgyo=; b=AKcOOadVNL4GWxumJDW32sJY9ZXj2FBuuyxf/2TiglSqtIdrQbjsUpaLzN3ExAVGLI 8Fob8/tQISpJkvSsFsKDQIPe7kV8X8N131mDO9dDLjLIa7x2UXyBR+APcJh+MnrOYTu2 HK/quUGA4mvl3TXfZcJonV0lyhH1KwQYwJzAiVnf+H1wBtumRmmh86TsqxyHbx3h6crP uXsxPhaSR4e5QCAvJi1IqdAwAg8EwACeoJphhpA5pgyAiRanCx6WHsOAxMAk0IgBqA2l kZyERhn7ZtQOC7Q1IM+N1Ek+K0QTP/0175QwSRdI3h80iFgqIxPQ73NSEFKYUMktiWv8 8GEQ== X-Received: by 10.68.228.36 with SMTP id sf4mr94843895pbc.0.1439603465092; Fri, 14 Aug 2015 18:51:05 -0700 (PDT) Received: from vaishali-Ideapad-Z570 ([43.249.235.7]) by smtp.gmail.com with ESMTPSA id rg10sm7377205pbc.33.2015.08.14.18.51.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Aug 2015 18:51:04 -0700 (PDT) Date: Sat, 15 Aug 2015 07:21:00 +0530 From: Vaishali Thakkar To: Mark Brown Message-ID: <20150815015059.GA31009@localhost> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: alsa-devel@alsa-project.org, Heiko Stuebner , linux-kernel@vger.kernel.org, Takashi Iwai , Liam Girdwood , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] ASoC: rockchip: i2s: Adjust devm usage 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 Remove use of snd_soc_unregister_component in remove function as devm_snd_soc_register_component in probe function automatically handles it. Also, convert call of snd_dmaengine_pcm_register to managed resource function devm_snd_dmaengine_pcm_register and remove usage of snd_dmaengine_pcm_unregister in probe and remove functions. Signed-off-by: Vaishali Thakkar --- sound/soc/rockchip/rockchip_i2s.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index acb5be5..b936102 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -483,16 +483,14 @@ static int rockchip_i2s_probe(struct platform_device *pdev) goto err_suspend; } - ret = snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); + ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); if (ret) { dev_err(&pdev->dev, "Could not register PCM\n"); - goto err_pcm_register; + return ret; } return 0; -err_pcm_register: - snd_dmaengine_pcm_unregister(&pdev->dev); err_suspend: if (!pm_runtime_status_suspended(&pdev->dev)) i2s_runtime_suspend(&pdev->dev); @@ -512,8 +510,6 @@ static int rockchip_i2s_remove(struct platform_device *pdev) clk_disable_unprepare(i2s->mclk); clk_disable_unprepare(i2s->hclk); - snd_dmaengine_pcm_unregister(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); return 0; }