From patchwork Fri Aug 29 16:16:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABl_PORTAY?= X-Patchwork-Id: 4811701 Return-Path: X-Original-To: patchwork-linux-arm@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 D50F0C0338 for ; Fri, 29 Aug 2014 16:20:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D89492010B for ; Fri, 29 Aug 2014 16:20:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 070D2200FF for ; Fri, 29 Aug 2014 16:20:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNOtG-0003ei-0c; Fri, 29 Aug 2014 16:19:06 +0000 Received: from 10.mo69.mail-out.ovh.net ([46.105.73.241] helo=mo69.mail-out.ovh.net) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNOtD-0003Z2-2l for linux-arm-kernel@lists.infradead.org; Fri, 29 Aug 2014 16:19:03 +0000 Received: from mail619.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo69.mail-out.ovh.net (Postfix) with SMTP id D4BE6FFBEF6 for ; Fri, 29 Aug 2014 18:18:37 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 29 Aug 2014 18:18:37 +0200 Received: from 19-157-190-109.dsl.ovh.fr (HELO localhost.localdomain) (g.portay@overkiz.com@109.190.157.19) by ns0.ovh.net with SMTP; 29 Aug 2014 18:18:37 +0200 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= To: Arnd Bergmann , Daniel Lezcano , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org, Nicolas Ferre , Thomas Gleixner , Thierry Reding , Boris Brezillon , Alexandre Belloni , Jean-Christophe PLAGNIOL-VILLARD Subject: [PATCHv2 1/4] ARM: at91/tclib: prefer using of devm_* functions Date: Fri, 29 Aug 2014 18:16:40 +0200 Message-Id: <1409329003-17252-2-git-send-email-g.portay@overkiz.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1409329003-17252-1-git-send-email-g.portay@overkiz.com> References: <1409329003-17252-1-git-send-email-g.portay@overkiz.com> MIME-Version: 1.0 X-Ovh-Tracer-Id: 12084283700882107141 X-Ovh-Remote: 109.190.157.19 (19-157-190-109.dsl.ovh.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejgedrtdeiucdltddurdefjeefrddttddmucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejgedrtdeiucdltddurdefjeefrddttddmucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140829_091903_266023_4695B75F X-CRM114-Status: GOOD ( 13.00 ) X-Spam-Score: -0.1 (/) Cc: =?utf-8?q?Ga=C3=ABl=20PORTAY?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Gaël PORTAY Signed-off-by: Gaël PORTAY Acked-by: Boris Brezillon --- drivers/misc/atmel_tclib.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/misc/atmel_tclib.c b/drivers/misc/atmel_tclib.c index c8d8e38..b514a2d 100644 --- a/drivers/misc/atmel_tclib.c +++ b/drivers/misc/atmel_tclib.c @@ -150,17 +150,15 @@ static int __init tc_probe(struct platform_device *pdev) if (irq < 0) return -EINVAL; - tc = kzalloc(sizeof(struct atmel_tc), GFP_KERNEL); + tc = devm_kzalloc(&pdev->dev, sizeof(struct atmel_tc), GFP_KERNEL); if (!tc) return -ENOMEM; tc->pdev = pdev; - clk = clk_get(&pdev->dev, "t0_clk"); - if (IS_ERR(clk)) { - kfree(tc); - return -EINVAL; - } + clk = devm_clk_get(&pdev->dev, "t0_clk"); + if (IS_ERR(clk)) + return PTR_ERR(clk); /* Now take SoC information if available */ if (pdev->dev.of_node) { @@ -171,10 +169,10 @@ static int __init tc_probe(struct platform_device *pdev) } tc->clk[0] = clk; - tc->clk[1] = clk_get(&pdev->dev, "t1_clk"); + tc->clk[1] = devm_clk_get(&pdev->dev, "t1_clk"); if (IS_ERR(tc->clk[1])) tc->clk[1] = clk; - tc->clk[2] = clk_get(&pdev->dev, "t2_clk"); + tc->clk[2] = devm_clk_get(&pdev->dev, "t2_clk"); if (IS_ERR(tc->clk[2])) tc->clk[2] = clk;