From patchwork Sat Sep 6 17:52:34 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: 386649 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 151721400D7 for ; Sun, 7 Sep 2014 03:55:57 +1000 (EST) 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 1XQKAt-0005bW-Um; Sat, 06 Sep 2014 17:53:23 +0000 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQKAm-0005WI-7m for linux-arm-kernel@lists.infradead.org; Sat, 06 Sep 2014 17:53:16 +0000 Received: by mail-we0-f175.google.com with SMTP id k48so12960574wev.6 for ; Sat, 06 Sep 2014 10:52:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=vRQqfpedERz3cr2SKDXyOVu84AXJrSUeDzriMdVK5jw=; b=O5qyd8JRd4EklL88fB64sHsihR/YTReK242c62La1ajA9/NPxq8BcDeI/wWGj0y5bV rscHxCT2S9DryG9ELGc/emG9RQdmW72wZExy2Ztow57ruAZteojcKrtyWOKSA8V+tqCx ST9yic6sdcPIokNiE6idv9lio/X047xdJ95olL67QHfuBqD8LYZOXEmWgAy5LonveoHa 0MZ3GaQTS4G3mPJc7MBrCSpxYnv2q2QMMUTxLVsHh5rK7h9VETxRupue5etLJu4reoz7 LTz7Dez58uyEyEKEAfo94PuK5moHalluBrSyQsWW4jFHnechRCzB18Ihiv2FLUK9P8yT r1Hg== X-Received: by 10.194.92.42 with SMTP id cj10mr2703789wjb.113.1410025973698; Sat, 06 Sep 2014 10:52:53 -0700 (PDT) Received: from localhost.localdomain ([78.206.137.189]) by mx.google.com with ESMTPSA id ll20sm5697978wic.14.2014.09.06.10.52.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Sep 2014 10:52:52 -0700 (PDT) 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: [PATCHv4 1/4] ARM: at91/tclib: prefer using of devm_* functions Date: Sat, 6 Sep 2014 19:52:34 +0200 Message-Id: <1410025957-5952-2-git-send-email-gael.portay@gmail.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1410025957-5952-1-git-send-email-gael.portay@gmail.com> References: <1410025957-5952-1-git-send-email-gael.portay@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140906_105316_424395_8DF617DB X-CRM114-Status: GOOD ( 12.42 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c03:0:0:0:22f listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (gael.portay[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 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;