From patchwork Fri Jul 11 04:14:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4530071 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5AD5ABEEAA for ; Fri, 11 Jul 2014 04:14:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5628A201F4 for ; Fri, 11 Jul 2014 04:14:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 143422017E for ; Fri, 11 Jul 2014 04:14:37 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DDD72264F1D; Fri, 11 Jul 2014 06:14:34 +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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A1965264ECA; Fri, 11 Jul 2014 06:14:26 +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 7680B264F06; Fri, 11 Jul 2014 06:14:25 +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 00BAA261B31 for ; Fri, 11 Jul 2014 06:14:16 +0200 (CEST) Received: by mail-pa0-f46.google.com with SMTP id eu11so714824pac.19 for ; Thu, 10 Jul 2014 21:14:15 -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=SX9wlisJhBwom2RYLncWeP8ipZ0aGU29M7UOEtyTZcc=; b=IuLuEqTkY1rI29cx/0O6H0xPwE3Pb6gMeCZVPiVtiqnmdPBdlwGOdXGEOzvGl+TY3N VuZ54ulNrh8FqRCtsdleS4ruRSZF44S+834kZDvCo4iKfLuGB23WBGaV2ccd16s1dAE+ uND89SvPtu+qB6bgtdxXJ+u3vb4GEDy/ZtL/55x7cZoFzLUE1OTMjjTqNCGkjNGclvjl tnA1w+qifVKUHPB8HYQ/RWOO8oVTr+QsKk7sgheiXvJLCgyxb7T/7jREDIG++rdTSz+2 h/UJxkbzK3SSZ9cZdpJ2mZu1Djs9v3YkKiVK1Z/dl+vl5C160+nFYK5EW0WajbVeowbF dkIw== X-Received: by 10.68.160.163 with SMTP id xl3mr52402901pbb.39.1405052055046; Thu, 10 Jul 2014 21:14:15 -0700 (PDT) Received: from localhost ([122.178.68.205]) by mx.google.com with ESMTPSA id j3sm1159641pdk.65.2014.07.10.21.14.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 10 Jul 2014 21:14:14 -0700 (PDT) Date: Fri, 11 Jul 2014 09:44:06 +0530 From: Himangi Saraogi To: Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-omap@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Message-ID: <20140711041406.GA4207@himangi-Dell> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: julia.lawall@lip6.fr Subject: [alsa-devel] [PATCH] ASoC: omap-dmic: Use devm_clk_get 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 This patch introduces the use of managed interfaces like devm_clk_get and does away with the clk_puts in the probe and remove functions. A label is also done away with. Signed-off-by: Himangi Saraogi Acked-by: Peter Ujfalusi --- This is a follow up to ASoC: omap-dmic: use managed interfaces which failed to apply as the other devm_ functions were introduced by a patch ASoC: omap-dmic: Use devm_snd_soc_register_component. sound/soc/omap/omap-dmic.c | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/sound/soc/omap/omap-dmic.c b/sound/soc/omap/omap-dmic.c index f125eb9..0f34e28 100644 --- a/sound/soc/omap/omap-dmic.c +++ b/sound/soc/omap/omap-dmic.c @@ -466,7 +466,7 @@ static int asoc_dmic_probe(struct platform_device *pdev) mutex_init(&dmic->mutex); - dmic->fclk = clk_get(dmic->dev, "fck"); + dmic->fclk = devm_clk_get(dmic->dev, "fck"); if (IS_ERR(dmic->fclk)) { dev_err(dmic->dev, "cant get fck\n"); return -ENODEV; @@ -475,8 +475,7 @@ static int asoc_dmic_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dma"); if (!res) { dev_err(dmic->dev, "invalid dma memory resource\n"); - ret = -ENODEV; - goto err_put_clk; + return -ENODEV; } dmic->dma_data.addr = res->start + OMAP_DMIC_DATA_REG; @@ -484,34 +483,19 @@ static int asoc_dmic_probe(struct platform_device *pdev) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mpu"); dmic->io_base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(dmic->io_base)) { - ret = PTR_ERR(dmic->io_base); - goto err_put_clk; - } + if (IS_ERR(dmic->io_base)) + return PTR_ERR(dmic->io_base); ret = devm_snd_soc_register_component(&pdev->dev, &omap_dmic_component, &omap_dmic_dai, 1); if (ret) - goto err_put_clk; + return ret; ret = omap_pcm_platform_register(&pdev->dev); if (ret) - goto err_put_clk; - - return 0; - -err_put_clk: - clk_put(dmic->fclk); - return ret; -} - -static int asoc_dmic_remove(struct platform_device *pdev) -{ - struct omap_dmic *dmic = platform_get_drvdata(pdev); - - clk_put(dmic->fclk); + return ret; return 0; } @@ -529,7 +513,6 @@ static struct platform_driver asoc_dmic_driver = { .of_match_table = omap_dmic_of_match, }, .probe = asoc_dmic_probe, - .remove = asoc_dmic_remove, }; module_platform_driver(asoc_dmic_driver);