From patchwork Tue Mar 14 20:22:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 9624435 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 E6701604A9 for ; Tue, 14 Mar 2017 20:29:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7AD328179 for ; Tue, 14 Mar 2017 20:29:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC2B728434; Tue, 14 Mar 2017 20:29:21 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 5C55228179 for ; Tue, 14 Mar 2017 20:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751642AbdCNU3V (ORCPT ); Tue, 14 Mar 2017 16:29:21 -0400 Received: from smtp-out-no.shaw.ca ([64.59.134.12]:47120 "EHLO smtp-out-no.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751286AbdCNU3V (ORCPT ); Tue, 14 Mar 2017 16:29:21 -0400 X-Greylist: delayed 310 seconds by postgrey-1.27 at vger.kernel.org; Tue, 14 Mar 2017 16:29:20 EDT Received: from triton.mmayer.net ([70.71.160.251]) by shaw.ca with SMTP id nszhc1mhi47SdnszicTEhG; Tue, 14 Mar 2017 14:24:34 -0600 X-Authority-Analysis: v=2.2 cv=P9pKvmIu c=1 sm=1 tr=0 a=6xzog4CasRozao6qlzTIAw==:117 a=6xzog4CasRozao6qlzTIAw==:17 a=6Iz7jQTuP9IA:10 a=Q-fNiiVtAAAA:8 a=VwQbUJbxAAAA:8 a=GAT1pexnEl9tdFb5mgIA:9 a=Fp8MccfUoT0GBdDC_Lng:22 a=AjGcO6oz07-iQ99wixmX:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 1C589385706A; Tue, 14 Mar 2017 13:24:33 -0700 (PDT) From: Markus Mayer To: Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland Cc: Markus Mayer , Linux Clock Mailing List , Device Tree Mailing List , Linux Kernel Mailing List Subject: [RFC 2/2] clk: divider: modifications for 4.11 Date: Tue, 14 Mar 2017 13:22:36 -0700 Message-Id: <20170314202236.39910-3-code@mmayer.net> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170314202236.39910-1-code@mmayer.net> References: <20170314202236.39910-1-code@mmayer.net> X-CMAE-Envelope: MS4wfEjif4yxJyodRrKL/8r7Hk0Kwq5RQRYcZ6jmBRB8TVmpHNAkZzkWqqJyxSY9XW1HBA4w/NyKLd0hKnPTAhhdcoeVlL2cbbpvjdzJBhLhR1OSOwtFIlN5 DKctLQVkYnVpARXJbqb9AOrkQRzW+XXW9XpnMVlcg3qYR5jIwz4fZKLNBRMgC2in7z2SGIl+MDbv81igNWOA/DZRQ0L8G/IccKh3a4lt9mthpfghyFDKgJhX WUaFQG9SWcuvOZZimu2sBLGhi678hWp2HRT65SSAHCMZkF1BTeJLJPJjDYnbcpYlG5xA//2HbFhksgsXXryexePH38gcgiSYFBqELyThFSf1dKbfXc8A05Wa Gnm14w9pxOW7yaCaGRi97YNcQ5WE76Y28YUG+ThBdtvUTOwL671WE1ogFrgfIcQb7pRDzsZx 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 From: Markus Mayer These changes were applied on top of the original commit[1]. Some changes are more stylistic in nature, others were necessary due to changes in the clock framework. - make of_clk_get_div_table() static - turn "u32 table_size" into "unsigned int table_size" - wrap two over-long pr_err() lines - change _register_divider() call and related code, since it is returning a (struct clk_hw *) now instead of (struct clk *) [1] https://patchwork.kernel.org/patch/2848065/ Signed-off-by: Markus Mayer --- drivers/clk/clk-divider.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c index df7290c..92605bc 100644 --- a/drivers/clk/clk-divider.c +++ b/drivers/clk/clk-divider.c @@ -617,10 +617,10 @@ EXPORT_SYMBOL_GPL(clk_hw_unregister_divider); #ifdef CONFIG_OF -struct clk_div_table *of_clk_get_div_table(struct device_node *node) +static struct clk_div_table *of_clk_get_div_table(struct device_node *node) { int i; - u32 table_size; + unsigned int table_size; struct clk_div_table *table; const __be32 *tablespec; u32 val; @@ -634,7 +634,8 @@ struct clk_div_table *of_clk_get_div_table(struct device_node *node) table = kzalloc(sizeof(struct clk_div_table) * table_size, GFP_KERNEL); if (!table) { - pr_err("%s: unable to allocate memory for %s table\n", __func__, node->name); + pr_err("%s: unable to allocate memory for %s table\n", __func__, + node->name); return NULL; } @@ -653,7 +654,7 @@ struct clk_div_table *of_clk_get_div_table(struct device_node *node) */ void of_divider_clk_setup(struct device_node *node) { - struct clk *clk; + struct clk_hw *hw; const char *clk_name = node->name; void __iomem *reg; const char *parent_name; @@ -673,7 +674,8 @@ void of_divider_clk_setup(struct device_node *node) } if (of_property_read_u32(node, "bit-mask", &mask)) { - pr_err("%s: missing bit-mask property for %s\n", __func__, node->name); + pr_err("%s: missing bit-mask property for %s\n", __func__, + node->name); return; } @@ -699,11 +701,11 @@ void of_divider_clk_setup(struct device_node *node) if (IS_ERR(table)) return; - clk = _register_divider(NULL, clk_name, parent_name, 0, reg, shift, + hw = _register_divider(NULL, clk_name, parent_name, 0, reg, shift, mask, clk_divider_flags, table, NULL); - if (!IS_ERR(clk)) - of_clk_add_provider(node, of_clk_src_simple_get, clk); + if (!IS_ERR(hw)) + of_clk_add_provider(node, of_clk_src_simple_get, hw->clk); } EXPORT_SYMBOL_GPL(of_divider_clk_setup); CLK_OF_DECLARE(divider_clk, "divider-clock", of_divider_clk_setup);