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: 4214021 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 0246B9F392 for ; Wed, 21 May 2014 03:25:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11D9A20384 for ; Wed, 21 May 2014 03:25:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34CFB20395 for ; Wed, 21 May 2014 03:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbaEUDYu (ORCPT ); Tue, 20 May 2014 23:24:50 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:61028 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751630AbaEUDYs (ORCPT ); Tue, 20 May 2014 23:24:48 -0400 Received: by mail-pa0-f52.google.com with SMTP id fa1so948491pad.39 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=kzRZbSm5nL7VvoOqJPGMHOscC2gkYH4sGcFE8fZu+vgRl4LT3v+TXMHLzaF/YmZK9N A+Szo7WjGfxfCVzD4zYPBGOEkyeUZWnJA2XA5+SQMUy2eUmvbgxxfoZEgBfUMSrmaB2o 7xkLW9QqCF5jfS4wbE/Td+As+TGLWuo8T3MUhxPWCi1Kk25dezOurB+QkzFrWTWsm/F2 sMH3A0b0R9X079OfKxgZ3rxAYMpXeb12xFMLB3YnZqABlcv9LFoz/e4EhSqgUJ/dpqMK ksijKS7H4NH+j6wvxgi+nFCctcKYMaX+hpZ3ky1LlE1ngiPDs0yXj89j5J+ottMrUSeh SAaQ== X-Gm-Message-State: ALoCoQk2BNhMcV0bH6LWbqNAIxJzz21Mh8MHlgiFi2hD6036Ppv4tZlfy8BIqnnToZ7kK5qxYh0Y 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 Cc: tiwai@suse.de, perex@perex.cz, broonie@kernel.org, lgirdwood@gmail.com, sbkim73@samsung.com, kgene.kim@samsung.com Subject: [PATCH 4/4] ASoC: samsung: Add devm_clk_get to pcm.c 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.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; }