From patchwork Thu Apr 5 12:57:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Gonzalez X-Patchwork-Id: 895374 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sigmadesigns.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qdhjeSRV"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40H2vG5YPmz9s0n for ; Thu, 5 Apr 2018 22:58:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QFsGEB8UZ32d92VyIymLWSA1Y6+Cm9M4Sm1CIN2scOw=; b=qdhjeSRVQkRwiA mIGFjgfQbzXk5YdNgAKA2GQIhiEtS5/KNlk7VItsvykvT644dZdNDM7DrKGAWvT+KC5sNTx+L01PH IYkQFY+WYvwFoLAmFbEGr9m3jBryGPjCGvoduGZvsupuHeSDRA3UixbbOPFMSh6HEbk6B9F169buo 9N2TS1XP2wsYRY7pGwHPZst4m9I1MQAFuCYjwtefXJhcNAPVxxmwAWPqZM1OhRtfbiChnjrIGRHDn 4DCRHcxnDmnJdfLly0jNx0SBHCenSsVJLFDp2it0s/NEtziMxacUmmfWLCnGNEWoGL1sf7yWtD+dW jSnur2g/A18LBKXOQS/g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f44T9-0002uT-7D; Thu, 05 Apr 2018 12:58:23 +0000 Received: from us-smtp-delivery-107.mimecast.com ([63.128.21.107]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f44T6-0002ss-TO for linux-mtd@lists.infradead.org; Thu, 05 Apr 2018 12:58:22 +0000 Received: from mpt-ex4.sdesigns.com (38.88.225.66 [38.88.225.66]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-84-Px0tM9vNNsWeYR0aCkvRfA-1; Thu, 05 Apr 2018 08:58:05 -0400 X-MC-Unique: Px0tM9vNNsWeYR0aCkvRfA-1 Received: from CPH-EX1.sdesigns.com (192.168.10.36) by MPT-EX1.sdesigns.com (10.10.9.81) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 5 Apr 2018 05:58:02 -0700 Received: from [172.27.0.114] (172.27.0.114) by CPH-EX1.sdesigns.com (192.168.10.36) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 5 Apr 2018 14:58:00 +0200 Subject: [PATCH v2] mtd: rawnand: tango: Fix struct clk memory leak To: Boris Brezillon , Miquel Raynal References: <1522811151-18853-1-git-send-email-wangxidong_97@163.com> <20180404082807.0f211578@xps13> <20180404090710.4f74b5b4@bbrezillon> From: Marc Gonzalez Message-ID: <8cffd501-b83f-8140-9cc6-021fcd90e277@sigmadesigns.com> Date: Thu, 5 Apr 2018 14:57:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.2 MIME-Version: 1.0 In-Reply-To: <20180404090710.4f74b5b4@bbrezillon> X-Originating-IP: [172.27.0.114] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180405_055821_022473_9A24EB85 X-CRM114-Status: GOOD ( 13.79 ) X-Spam-Score: -1.6 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [63.128.21.107 listed in list.dnswl.org] 0.7 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mans Rullgard , Marek Vasut , Richard Weinberger , Marc Gonzalez , Xidong Wang , linux-mtd , Cyrille Pitchen , Brian Norris , David Woodhouse Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use devm_clk_get() to let Linux manage struct clk memory. Fixes: 6956e2385a16 ("add tango NAND flash controller support") Reported-by: Xidong Wang Signed-off-by: Marc Gonzalez Reviewed-by: Miquel Raynal --- Missing clk_prepare_enable() would be handled in a separate patch. --- drivers/mtd/nand/tango_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/tango_nand.c b/drivers/mtd/nand/tango_nand.c index c5bee00b7f5e..76761b841f1f 100644 --- a/drivers/mtd/nand/tango_nand.c +++ b/drivers/mtd/nand/tango_nand.c @@ -643,7 +643,7 @@ static int tango_nand_probe(struct platform_device *pdev) writel_relaxed(MODE_RAW, nfc->pbus_base + PBUS_PAD_MODE); - clk = clk_get(&pdev->dev, NULL); + clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(clk)) return PTR_ERR(clk);