linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: bcm: kona: Remove unused scaled_div_build
@ 2025-05-05  1:35 linux
  2025-05-06 21:36 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: linux @ 2025-05-05  1:35 UTC (permalink / raw)
  To: florian.fainelli, rjui, sbranden, mturquette, sboyd
  Cc: bcm-kernel-feedback-list, linux-clk, linux-kernel,
	Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

scaled_div_build() was added in 2014 by
commit 1f27f15258bf ("clk: bcm281xx: add initial clock framework support")
but hasn't been used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/clk/bcm/clk-kona.c | 18 ------------------
 drivers/clk/bcm/clk-kona.h |  2 --
 2 files changed, 20 deletions(-)

diff --git a/drivers/clk/bcm/clk-kona.c b/drivers/clk/bcm/clk-kona.c
index 2b0ea882f1e4..0171e6b2bfca 100644
--- a/drivers/clk/bcm/clk-kona.c
+++ b/drivers/clk/bcm/clk-kona.c
@@ -53,24 +53,6 @@ static inline u64 scaled_div_value(struct bcm_clk_div *div, u32 reg_div)
 	return (u64)reg_div + ((u64)1 << div->u.s.frac_width);
 }
 
-/*
- * Build a scaled divider value as close as possible to the
- * given whole part (div_value) and fractional part (expressed
- * in billionths).
- */
-u64 scaled_div_build(struct bcm_clk_div *div, u32 div_value, u32 billionths)
-{
-	u64 combined;
-
-	BUG_ON(!div_value);
-	BUG_ON(billionths >= BILLION);
-
-	combined = (u64)div_value * BILLION + billionths;
-	combined <<= div->u.s.frac_width;
-
-	return DIV_ROUND_CLOSEST_ULL(combined, BILLION);
-}
-
 /* The scaled minimum divisor representable by a divider */
 static inline u64
 scaled_div_min(struct bcm_clk_div *div)
diff --git a/drivers/clk/bcm/clk-kona.h b/drivers/clk/bcm/clk-kona.h
index e09655024ac2..348a3454ce40 100644
--- a/drivers/clk/bcm/clk-kona.h
+++ b/drivers/clk/bcm/clk-kona.h
@@ -492,8 +492,6 @@ extern struct clk_ops kona_peri_clk_ops;
 /* Externally visible functions */
 
 extern u64 scaled_div_max(struct bcm_clk_div *div);
-extern u64 scaled_div_build(struct bcm_clk_div *div, u32 div_value,
-				u32 billionths);
 
 extern void __init kona_dt_ccu_setup(struct ccu_data *ccu,
 				struct device_node *node);
-- 
2.49.0


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

* Re: [PATCH] clk: bcm: kona: Remove unused scaled_div_build
  2025-05-05  1:35 [PATCH] clk: bcm: kona: Remove unused scaled_div_build linux
@ 2025-05-06 21:36 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2025-05-06 21:36 UTC (permalink / raw)
  To: florian.fainelli, linux, mturquette, rjui, sbranden
  Cc: bcm-kernel-feedback-list, linux-clk, linux-kernel,
	Dr. David Alan Gilbert

Quoting linux@treblig.org (2025-05-04 18:35:45)
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> scaled_div_build() was added in 2014 by
> commit 1f27f15258bf ("clk: bcm281xx: add initial clock framework support")
> but hasn't been used.
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---

Applied to clk-next

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

end of thread, other threads:[~2025-05-06 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-05  1:35 [PATCH] clk: bcm: kona: Remove unused scaled_div_build linux
2025-05-06 21:36 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).