From mboxrd@z Thu Jan 1 00:00:00 1970 From: sboyd@codeaurora.org (Stephen Boyd) Date: Thu, 4 Jun 2015 11:14:04 -0700 Subject: [PATCH 5/5] [RFC] ARM: timer-sp: Use of_clk_get_parent_count() instead of open coding In-Reply-To: References: <1432891549-23295-1-git-send-email-geert+renesas@glider.be> <1432891549-23295-6-git-send-email-geert+renesas@glider.be> <20150603234426.GB490@codeaurora.org> Message-ID: <20150604181404.GF490@codeaurora.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 06/04, Geert Uytterhoeven wrote: > Hi Stephen, > > On Thu, Jun 4, 2015 at 1:44 AM, Stephen Boyd wrote: > > On 05/29, Geert Uytterhoeven wrote: > >> Signed-off-by: Geert Uytterhoeven > >> #include > >> #include > >> #include > >> @@ -234,7 +235,7 @@ static void __init sp804_of_init(struct device_node *np) > >> clk1 = NULL; > >> > >> /* Get the 2nd clock if the timer has 3 timer clocks */ > >> - if (of_count_phandle_with_args(np, "clocks", "#clock-cells") == 3) { > >> + if (of_clk_get_parent_count(np) == 3) { > > > > So maybe it means if we want to expose of_clk_get_parent_count() > > we should move it to some other header file (of_clk.h?). And then > > maybe we should always compile said helpers if OF=y and > > HAVE_CLK=y. > > That makes sense. > > Currently we have lots of of_clk_*() in , and a few > of_clk_get*() in . > And the mysterious of_clk_set_defaults() in . > > All of_clk_get*() could be moved to a new . > > Alternatively, of_clk_get_parent_count() could just move to ? Hmm... of_clk_*() functions that return a struct clk * or work with a struct clk * should stay within clk.h. But these ones in clk-provider.h should probably move to a new of_clk.h file: of_clk_get_parent_count of_clk_get_parent_name of_clk_init -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project