From patchwork Wed May 21 03:22:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 4214081 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2349B9F334 for ; Wed, 21 May 2014 03:28:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 231952038C for ; Wed, 21 May 2014 03:28:09 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E1E9A2037A for ; Wed, 21 May 2014 03:28:07 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C31B22655C4; Wed, 21 May 2014 05:28:06 +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=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id ECA81265584; Wed, 21 May 2014 05:25:20 +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 E0583265584; Wed, 21 May 2014 05:25:17 +0200 (CEST) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by alsa0.perex.cz (Postfix) with ESMTP id 898EB265558 for ; Wed, 21 May 2014 05:24:49 +0200 (CEST) Received: by mail-pd0-f176.google.com with SMTP id p10so938572pdj.35 for ; Tue, 20 May 2014 20:24:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uxGy1TCNuuXimZ4sb2OVjZBXQ1P9ahTNBp6vp10h/Sk=; b=jzlySrj2QOPRb0pTFZVHbSm8EPonsUbfADvCWshfUyOm28KALbLPg3i5PZIf+SRTcN O9PlbF0akgrCE5OVe+V9D1o1DtdgZGXrowEO3nly5HC5khvlSIMpwYMbxRl9ttRHuPfR UL/8kRvut/RoE95X57+bGieWrbPlWc0SQvf9t+Oul6hjYc7X3UiTMMhbqsyJFC0O2vN3 PTvn/Abh2yz9HpSsgGtcI29UyuuU8H9jdH9x/AERJQSCTF/CjKds4pB7p7FRfY6GqMaG C8bKp3csZEuBUSY/e8cWOhNYo9Fjmg/X0bH8ewszUssmSX8VfWDuYV0djLA+MVux9ep8 /czw== X-Gm-Message-State: ALoCoQmmGA+NUqGh6ZqoNapI6cHzVghjAqzjren4/pdi5hXRsjkxaUEXGri9u8R/YZjBlAy8B88h X-Received: by 10.66.186.238 with SMTP id fn14mr55045764pac.135.1400642687568; Tue, 20 May 2014 20:24:47 -0700 (PDT) Received: from linaro.sisodomain.com ([14.140.216.146]) by mx.google.com with ESMTPSA id pb7sm98425440pac.10.2014.05.20.20.24.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 20:24:46 -0700 (PDT) From: Tushar Behera To: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org Date: Wed, 21 May 2014 08:52:20 +0530 Message-Id: <1400642540-24375-5-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400642540-24375-1-git-send-email-tushar.behera@linaro.org> References: <1400642540-24375-1-git-send-email-tushar.behera@linaro.org> Cc: kgene.kim@samsung.com, tiwai@suse.de, lgirdwood@gmail.com, sbkim73@samsung.com, broonie@kernel.org Subject: [alsa-devel] [PATCH 4/4] ASoC: samsung: Add devm_clk_get to pcm.c 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 clk_get in probe function can be safely replaced with devm_clk_get. Signed-off-by: Tushar Behera --- sound/soc/samsung/pcm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index 90fcd52..a3c9c9c 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c @@ -542,7 +542,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) /* Default is 128fs */ pcm->sclk_per_fs = 128; - pcm->cclk = clk_get(&pdev->dev, "audio-bus"); + pcm->cclk = devm_clk_get(&pdev->dev, "audio-bus"); if (IS_ERR(pcm->cclk)) { dev_err(&pdev->dev, "failed to get audio-bus\n"); ret = PTR_ERR(pcm->cclk); @@ -567,7 +567,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) goto err3; } - pcm->pclk = clk_get(&pdev->dev, "pcm"); + pcm->pclk = devm_clk_get(&pdev->dev, "pcm"); if (IS_ERR(pcm->pclk)) { dev_err(&pdev->dev, "failed to get pcm_clock\n"); ret = -ENOENT; @@ -605,14 +605,12 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) err5: clk_disable_unprepare(pcm->pclk); - clk_put(pcm->pclk); err4: iounmap(pcm->regs); err3: release_mem_region(mem_res->start, resource_size(mem_res)); err2: clk_disable_unprepare(pcm->cclk); - clk_put(pcm->cclk); err1: return ret; } @@ -631,8 +629,6 @@ static int s3c_pcm_dev_remove(struct platform_device *pdev) clk_disable_unprepare(pcm->cclk); clk_disable_unprepare(pcm->pclk); - clk_put(pcm->pclk); - clk_put(pcm->cclk); return 0; }