Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752827AbdCNUYh (ORCPT ); Tue, 14 Mar 2017 16:24:37 -0400 Received: from smtp-out-no.shaw.ca ([64.59.134.12]:46502 "EHLO smtp-out-no.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688AbdCNUYf (ORCPT ); Tue, 14 Mar 2017 16:24:35 -0400 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 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2727 Lines: 82 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); -- 2.7.4