From patchwork Fri Jan 5 00:38:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10145877 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 71D7260244 for ; Fri, 5 Jan 2018 00:43:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A985328882 for ; Fri, 5 Jan 2018 00:43:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E4DF28885; Fri, 5 Jan 2018 00:43:10 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3475B28882 for ; Fri, 5 Jan 2018 00:43:10 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=ZvRBNq4bezlHUEpicFpLCp7waIOn+BJgGGhRkcDgAAQ=; b=AMCEVvlZXN6/+S3fd6ydmOMl5i bAe3DDj0kEhZdweVOWeU/5whnIpgZD8m6NFhby4+dwA3ZHLT6Yy76wLBLJuaofJ60LIxDtPOheidI VLM1YLNxGUAgM96j5xFl22Ymlem2h3JisTZLF20C3pko5TmFrfAJBme8EQTOl3G+O/0+ZgRaOsz7Q gGD/UECjTZl4i14pYBbub4SOjLOXSfXpFDJzGlxM+gE+WH/Ns1AMJcvlhkH4IIG3s2US+Q2P7hH4q dZHcityAnqhq+URLPOb6Tto2+/M/mtdzsEBd4eV6ccLPyflS2Wz9tXKi/JD2l2JBgsbRlzluJu6+F dYXMaM0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eXG6E-0003Kg-2M; Fri, 05 Jan 2018 00:43:06 +0000 Received: from vern.gendns.com ([206.190.152.46]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eXG46-0001zD-In; Fri, 05 Jan 2018 00:41:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7H6Md5L38vvngoNwfHXTwipiTgyw2EfKwAqwcNtmYqA=; b=zrR51DkSzuPpkyOuNhUfCfovq VC+OUC+3OBTnliNzdOZdHWTf3sl/V7vLUDys7vGVi+uJ4e0pDy6YDBH+SLbiqMMAfIU2i9bQzoORj 5gxmsGERbPvTn6mHjmWTzJU7Fo6tNrRBYRSMxSPIgd8xO81kNZY3EYc3WXxxcazJkN4xI7VDrLi1m 9TPROwXzRZpvThNHsKw9nBZnGK7v0bRHJmR6uxZMpbrj9+7KGZ0F8KLmBQd+yeKkGVu2gMGizzp5X zui7UPyyPsB0ulD6ObeF1cz3B1xd0/3DhRCSSCIk451MiH1fAiSfoLxDRzUujj8W0HKkwZHiE8z83 7O3fwG1cA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:37626 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1eXG40-003bYU-EV; Thu, 04 Jan 2018 19:40:48 -0500 From: David Lechner To: linux-clk@vger.kernel.org Subject: [PATCH 5/7] clk: rockchip: make use of clk_alloc_onecell_data() Date: Thu, 4 Jan 2018 18:38:10 -0600 Message-Id: <1515112695-3160-6-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515112695-3160-1-git-send-email-david@lechnology.com> References: <1515112695-3160-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180104_164055_341731_8A6F7C81 X-CRM114-Status: UNSURE ( 5.39 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Lechner , =?UTF-8?q?Emilio=20L=C3=B3pez?= , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Chen-Yu Tsai , linux-mediatek@lists.infradead.org, Matthias Brugger , Maxime Ripard , linux-arm-kernel@lists.infradead.org, Heiko Stuebner MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use helper function clk_alloc_onecell_data() to allocate struct clk_onecell_data. Signed-off-by: David Lechner --- drivers/clk/rockchip/clk-rockchip.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/clk/rockchip/clk-rockchip.c b/drivers/clk/rockchip/clk-rockchip.c index 2c9bb81..499af3a 100644 --- a/drivers/clk/rockchip/clk-rockchip.c +++ b/drivers/clk/rockchip/clk-rockchip.c @@ -52,19 +52,12 @@ static void __init rk2928_gate_clk_init(struct device_node *node) if (!reg) return; - clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); + clk_data = clk_alloc_onecell_data(qty); if (!clk_data) { iounmap(reg); return; } - clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL); - if (!clk_data->clks) { - kfree(clk_data); - iounmap(reg); - return; - } - flags = CLK_GATE_HIWORD_MASK | CLK_GATE_SET_TO_DISABLE; for (i = 0; i < qty; i++) { @@ -91,8 +84,6 @@ static void __init rk2928_gate_clk_init(struct device_node *node) WARN_ON(IS_ERR(clk_data->clks[i])); } - clk_data->clk_num = qty; - of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); } CLK_OF_DECLARE(rk2928_gate, "rockchip,rk2928-gate-clk", rk2928_gate_clk_init);