mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] clk: change clk_get_num_parents into clk_hw_get_num_parents
@ 2022-01-14  6:59 Ahmad Fatoum
  2022-01-14  6:59 ` [PATCH 2/2] clk: propagate error pointers in clk_hw_to_clk and clk_to_clk_hw Ahmad Fatoum
  2022-01-14  8:26 ` [PATCH 1/2] clk: change clk_get_num_parents into clk_hw_get_num_parents Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2022-01-14  6:59 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

There is no clk_get_num_parents in Linux, but clk_hw_get_num_parents.
Our only users uses it with a clk_hw, so adjust the function
accordingly.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/clk/at91/clk-generated.c | 2 +-
 include/linux/clk.h              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c
index 628ff407d91e..e639fb3a1a65 100644
--- a/drivers/clk/at91/clk-generated.c
+++ b/drivers/clk/at91/clk-generated.c
@@ -92,7 +92,7 @@ static int clk_generated_set_parent(struct clk_hw *hw, u8 index)
 {
 	struct clk_generated *gck = to_clk_generated(hw);
 
-	if (index >= clk_get_num_parents(clk_hw_to_clk(hw)))
+	if (index >= clk_hw_get_num_parents(hw))
 		return -EINVAL;
 
 	gck->parent_id = index;
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 6565429a9b9f..481c28871258 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -721,9 +721,9 @@ int of_clk_add_provider(struct device_node *np,
 						   void *data),
 			void *data);
 
-static inline unsigned int clk_get_num_parents(const struct clk *hw)
+static inline unsigned int clk_hw_get_num_parents(const struct clk_hw *hw)
 {
-	return hw->num_parents;
+	return hw->clk.num_parents;
 }
 
 #else
-- 
2.33.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-14  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14  6:59 [PATCH 1/2] clk: change clk_get_num_parents into clk_hw_get_num_parents Ahmad Fatoum
2022-01-14  6:59 ` [PATCH 2/2] clk: propagate error pointers in clk_hw_to_clk and clk_to_clk_hw Ahmad Fatoum
2022-01-14  8:26 ` [PATCH 1/2] clk: change clk_get_num_parents into clk_hw_get_num_parents Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox