From patchwork Mon Apr 9 14:37:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yixun Lan X-Patchwork-Id: 10331543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B75176022E for ; Mon, 9 Apr 2018 14:39:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3F7D28919 for ; Mon, 9 Apr 2018 14:39:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96FAE2892D; Mon, 9 Apr 2018 14:39:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 93F4328919 for ; Mon, 9 Apr 2018 14:39:17 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nWKtlpztQSiypVqpVV6U24XJ3G3DqmDt9w0qhLb4LAk=; b=V6bGe4cw0V6aGy 5XBJe3equbaWAlRL6UagdBIpybBl+mQE7NznFg2q9agwjGkJtfAchZ32MjXqqUEEL4VMLh5NzjAgD NLjwwTeN+uxHgf/yvWy5U/44giZiw3GBSuz/W8i2ZIYNd3NFKokjTlxIM0lxvfT55ydPal+Khh4Ru 4hexeMrPvsAI29lmdjTIIHRa140tfL1mGr7HBA0iNI4UK1G5Jk5giWJ8esBAXoLGw3hUgbrmED88M esgciWO1LglFmbA4LqNySnklsZ5NEJMWqV+hl+j9E23KglfgxF79ZtqOyprYPzsDt0YQJiswTZGwP xAwV7yMDrHAlFFMouKqA==; 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 1f5Xwx-00053X-UP; Mon, 09 Apr 2018 14:39:15 +0000 Received: from mail-sh2.amlogic.com ([58.32.228.45]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5Xwl-0004sl-RH; Mon, 09 Apr 2018 14:39:14 +0000 Received: from ofmlt.linux-actions.org (10.18.20.235) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server id 15.0.1320.4; Mon, 9 Apr 2018 22:38:28 +0800 From: Yixun Lan To: Neil Armstrong , Jerome Brunet , Kevin Hilman , Carlo Caione Subject: [PATCH v5 1/7] clk: meson: migrate to devm_of_clk_add_hw_provider API Date: Mon, 9 Apr 2018 22:37:43 +0800 Message-ID: <20180409143749.71197-2-yixun.lan@amlogic.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180409143749.71197-1-yixun.lan@amlogic.com> References: <20180409143749.71197-1-yixun.lan@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.18.20.235] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180409_073903_920308_17FA541B X-CRM114-Status: GOOD ( 10.62 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Stephen Boyd , Michael Turquette , Yixun Lan , linux-kernel@vger.kernel.org, Qiufang Dai , Philipp Zabel , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There is a protential memory leak, as of_clk_del_provider is never called if of_clk_add_hw_provider has been executed. Fix this by using devm variant API. Fixes: f8c11f79912d ("clk: meson: Add GXBB AO Clock and Reset controller driver") Suggested-by: Stephen Boyd Signed-off-by: Yixun Lan --- drivers/clk/meson/gxbb-aoclk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/meson/gxbb-aoclk.c b/drivers/clk/meson/gxbb-aoclk.c index 9ec23ae9a219..eebb580b9e0f 100644 --- a/drivers/clk/meson/gxbb-aoclk.c +++ b/drivers/clk/meson/gxbb-aoclk.c @@ -191,7 +191,7 @@ static int gxbb_aoclkc_probe(struct platform_device *pdev) if (ret) return ret; - return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get, + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, &gxbb_aoclk_onecell_data); }