From patchwork Tue Dec 30 10:55:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jackson X-Patchwork-Id: 5551871 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CB53C9F2ED for ; Tue, 30 Dec 2014 10:58:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 060ED20160 for ; Tue, 30 Dec 2014 10:58:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D3092200FE for ; Tue, 30 Dec 2014 10:58:48 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 15FCB2606E0; Tue, 30 Dec 2014 11:58:48 +0100 (CET) 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 0310E26062E; Tue, 30 Dec 2014 11:56:19 +0100 (CET) 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 22D5B260605; Tue, 30 Dec 2014 11:56:10 +0100 (CET) Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by alsa0.perex.cz (Postfix) with ESMTP id A5F5F260600 for ; Tue, 30 Dec 2014 11:55:59 +0100 (CET) Received: from e106787-lin.cambridge.arm.com (e106787-lin.cambridge.arm.com [10.1.193.37]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id sBUAtuTM023176; Tue, 30 Dec 2014 10:55:58 GMT From: Andrew Jackson To: Jaroslav Kysela , Takashi Iwai , Mark Brown Date: Tue, 30 Dec 2014 10:55:43 +0000 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, Lars-Peter Clausen , pawel.moll@arm.com, Arnd Bergmann , ijc+devicetree@hellion.org.uk, linux-kernel@vger.kernel.org, Andrew Jackson , Liviu Dudau , Liam Girdwood , Rajeev Kumar , robh+dt@kernel.org, galak@codeaurora.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH v5 1/6] ASoC: dwc: Switch to managed clock resource 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 From: Andrew Jackson Simplify error handling during probe by using managed clock resources. Signed-off-by: Andrew Jackson --- sound/soc/dwc/designware_i2s.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index 06d3a34..5e9d163 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -407,13 +407,13 @@ static int dw_i2s_probe(struct platform_device *pdev) dev->capability = pdata->cap; dev->i2s_clk_cfg = pdata->i2s_clk_cfg; - dev->clk = clk_get(&pdev->dev, NULL); + dev->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(dev->clk)) return PTR_ERR(dev->clk); ret = clk_enable(dev->clk); if (ret < 0) - goto err_clk_put; + return ret; dev_set_drvdata(&pdev->dev, dev); ret = snd_soc_register_component(&pdev->dev, &dw_i2s_component, @@ -427,19 +427,13 @@ static int dw_i2s_probe(struct platform_device *pdev) err_clk_disable: clk_disable(dev->clk); -err_clk_put: - clk_put(dev->clk); return ret; } static int dw_i2s_remove(struct platform_device *pdev) { - struct dw_i2s_dev *dev = dev_get_drvdata(&pdev->dev); - snd_soc_unregister_component(&pdev->dev); - clk_put(dev->clk); - return 0; }