From patchwork Fri Jan 5 00:38:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 10145881 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 E9BD160244 for ; Fri, 5 Jan 2018 00:43:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C80828882 for ; Fri, 5 Jan 2018 00:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20BCF28885; Fri, 5 Jan 2018 00:43:44 +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 A92D428882 for ; Fri, 5 Jan 2018 00:43:43 +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=bO//F0pZWMeR2dTxRewNaIPBa8q2zMw51ppzsm6OQ6w=; b=WzK4Df1nLB9GpTrO7q6W9CBsI+ 6bKs7Csn45AV7h5GXVpHwiNJKqb6Wpat+7DVnVNLStAMi1x5uyxQw08t3QQ4Zsf9wnuWlTGuQJGjH xBJUrUOZ7iDPgltQC4DOV4QjH2xD60LWEVE57bBJlSqQSG8Ox4DFJsF4kM570P8nSW2Wk8M4ln/TW whVPZAM0vwpB3us93CVf/n0m//lASqg17A1IgvG0ADhuFoPG+7axkfxZW4UvPflJqYRnnc5t1l5ZX 1ojCnq+E/VC9+hXjj1wtxhJwIboELqHqADh8KMqPIZC8e4CP/5hJQpB3eoFmoIVMlVtMnM0KUXJmt 1FM6uKOw==; 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 1eXG6l-0003iR-Ah; Fri, 05 Jan 2018 00:43:39 +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-0001wX-Iq; Fri, 05 Jan 2018 00:41:17 +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=NvjMvtkZZtoAidGR2/lBct41ad+mXhgJ4gFtLyNZRRw=; b=h8bYz9ZmM5oiFZ8gLaleywaUh VVvVwWaqYH25X4GYlaZbVP41SE4m3VjJFUzVc71djypYpCk8RtLtVwnV/qOJWrln40+L4e4AZsofC sbONRDy66zd8UZCDbA6gHobWBzTJO/6cJ0BsJH9ziHVC55C9Wx+pUbsXMYj6jIhcwM1kysgq6RZU9 AOd7yXQLQiMaJFlSYwN0xTAhZZQRq4k3F8KfbX/R9k3sgJCUQ/FqzxWbRbmbh5kG2WowwU4E1cCAv /e80LhoKw1vTDeWjIMwx1nmN7y69VNREG2aHv5ylcK4y79fjXYVVAx5THWsqMoYxxGRYXCSOoNm1t Zll437h7g==; 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 1eXG3v-003bYU-SP; Thu, 04 Jan 2018 19:40:44 -0500 From: David Lechner To: linux-clk@vger.kernel.org Subject: [PATCH 4/7] clk: hisilicon: make use of clk_alloc_onecell_data() Date: Thu, 4 Jan 2018 18:38:09 -0600 Message-Id: <1515112695-3160-5-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_426470_B6521D86 X-CRM114-Status: UNSURE ( 5.80 ) 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/hisilicon/clk-hi3620.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/clk/hisilicon/clk-hi3620.c b/drivers/clk/hisilicon/clk-hi3620.c index 77072c7..15f8d50 100644 --- a/drivers/clk/hisilicon/clk-hi3620.c +++ b/drivers/clk/hisilicon/clk-hi3620.c @@ -476,21 +476,16 @@ static void __init hi3620_mmc_clk_init(struct device_node *node) return; } - clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); + clk_data = clk_alloc_onecell_data(num); if (WARN_ON(!clk_data)) return; - clk_data->clks = kcalloc(num, sizeof(*clk_data->clks), GFP_KERNEL); - if (!clk_data->clks) - return; - for (i = 0; i < num; i++) { struct hisi_mmc_clock *mmc_clk = &hi3620_mmc_clks[i]; clk_data->clks[mmc_clk->id] = hisi_register_clk_mmc(mmc_clk, base, node); } - clk_data->clk_num = num; of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); }