From patchwork Wed Jun 1 23:15:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 9148729 X-Patchwork-Delegate: sboyd@codeaurora.org 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 3B5F960751 for ; Wed, 1 Jun 2016 23:22:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E1C2271F1 for ; Wed, 1 Jun 2016 23:22:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22F42271FD; Wed, 1 Jun 2016 23:22:52 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D04326FA0 for ; Wed, 1 Jun 2016 23:22:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750967AbcFAXWY (ORCPT ); Wed, 1 Jun 2016 19:22:24 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34137 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751963AbcFAXP4 (ORCPT ); Wed, 1 Jun 2016 19:15:56 -0400 Received: by mail-pf0-f182.google.com with SMTP id 62so23302242pfd.1 for ; Wed, 01 Jun 2016 16:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l2BU6rH6XINLia5+RbWnO7BP14DC4ZpKDEOgDE7+pxE=; b=A9M2zWmaGHDTBiIoVoZNq+x2asiYGzyQcLkQqgmGwTNOp7FgfvsVhK0FR+DrFcN8Bi +YFxiUrz+jXqtcDNp6jgl/tnLmCmYN1z1dCajPQhk/Gjxz+U6JWND/BJDIdXfd1ybha5 wO/IxjUSu4dCZNwEzfLCmBEfzBURc0xsVv4pg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l2BU6rH6XINLia5+RbWnO7BP14DC4ZpKDEOgDE7+pxE=; b=mOO7g9qS2ld8WhwdEF1D3rWqTW5t46dMZO/Q8UFypo9kV31ncs9EHpZ0Chzpj06fs/ 0hQQCWeAShpSW3fJJ2r1xCYPqe5FsCL1XIgCW28mcRhK3+VH9fjRmRO3S4rvBFJEBYnQ meh3zysweo8obelqYfmwAYqnSZ9vk5sL1jfW980hgT4+nM/Zq7DXP2S+4VtJLh4YuFt6 NMkiCzkSPjLJGXQZKMbLDAsz0RXA3+duEb9PoAqbhfdSlujdHIVDcXDirGXvcE2VwizQ LPVBWv35c4TiVe8BDBMYziw8YEZVI0y9cx9aeJVjfuhAdqHIeL+Ie0YE+Rjw/I4t4Exk lpMQ== X-Gm-Message-State: ALyK8tItS119TibQwZ1DdGSVbFUDggy/Z8C2mzXRkUKl9L5hA/1kHfw2vZ2gayn7s/RHdkDK X-Received: by 10.98.56.141 with SMTP id f135mr13473541pfa.159.1464822956023; Wed, 01 Jun 2016 16:15:56 -0700 (PDT) Received: from localhost.localdomain (pat_11.qualcomm.com. [192.35.156.11]) by smtp.gmail.com with ESMTPSA id r64sm20967395pfi.54.2016.06.01.16.15.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Jun 2016 16:15:55 -0700 (PDT) From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jonas Jensen Subject: [PATCH 19/34] clk: moxart: Migrate to clk_hw based OF and registration APIs Date: Wed, 1 Jun 2016 16:15:18 -0700 Message-Id: <20160601231533.9354-20-stephen.boyd@linaro.org> X-Mailer: git-send-email 2.9.0-rc1 In-Reply-To: <20160601231533.9354-1-stephen.boyd@linaro.org> References: <20160601231533.9354-1-stephen.boyd@linaro.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have clk_hw based provider APIs to register clks, we can get rid of struct clk pointers while registering clks in these drivers, allowing us to move closer to a clear split of consumer and provider clk APIs. Cc: Jonas Jensen Signed-off-by: Stephen Boyd --- See commit 58657d189a2f and it's children for details on this new registration API. drivers/clk/clk-moxart.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/clk/clk-moxart.c b/drivers/clk/clk-moxart.c index f37f719643ec..b86dac851116 100644 --- a/drivers/clk/clk-moxart.c +++ b/drivers/clk/clk-moxart.c @@ -19,7 +19,8 @@ static void __init moxart_of_pll_clk_init(struct device_node *node) { static void __iomem *base; - struct clk *clk, *ref_clk; + struct clk_hw *hw; + struct clk *ref_clk; unsigned int mul; const char *name = node->name; const char *parent_name; @@ -42,14 +43,14 @@ static void __init moxart_of_pll_clk_init(struct device_node *node) return; } - clk = clk_register_fixed_factor(NULL, name, parent_name, 0, mul, 1); - if (IS_ERR(clk)) { + hw = clk_hw_register_fixed_factor(NULL, name, parent_name, 0, mul, 1); + if (IS_ERR(hw)) { pr_err("%s: failed to register clock\n", node->full_name); return; } - clk_register_clkdev(clk, NULL, name); - of_clk_add_provider(node, of_clk_src_simple_get, clk); + clk_hw_register_clkdev(hw, NULL, name); + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); } CLK_OF_DECLARE(moxart_pll_clock, "moxa,moxart-pll-clock", moxart_of_pll_clk_init); @@ -57,7 +58,8 @@ CLK_OF_DECLARE(moxart_pll_clock, "moxa,moxart-pll-clock", static void __init moxart_of_apb_clk_init(struct device_node *node) { static void __iomem *base; - struct clk *clk, *pll_clk; + struct clk_hw *hw; + struct clk *pll_clk; unsigned int div, val; unsigned int div_idx[] = { 2, 3, 4, 6, 8}; const char *name = node->name; @@ -85,14 +87,14 @@ static void __init moxart_of_apb_clk_init(struct device_node *node) return; } - clk = clk_register_fixed_factor(NULL, name, parent_name, 0, 1, div); - if (IS_ERR(clk)) { + hw = clk_hw_register_fixed_factor(NULL, name, parent_name, 0, 1, div); + if (IS_ERR(hw)) { pr_err("%s: failed to register clock\n", node->full_name); return; } - clk_register_clkdev(clk, NULL, name); - of_clk_add_provider(node, of_clk_src_simple_get, clk); + clk_hw_register_clkdev(hw, NULL, name); + of_clk_add_hw_provider(node, of_clk_hw_simple_get, hw); } CLK_OF_DECLARE(moxart_apb_clock, "moxa,moxart-apb-clock", moxart_of_apb_clk_init);