diff mbox series

[5.10.y-cip,13/53] clk: renesas: rzg2l: Simplify .determine_rate()

Message ID 20240419081742.3496709-14-claudiu.beznea.uj@bp.renesas.com (mailing list archive)
State New
Headers show
Series Add initial support for the Renesas RZ/G3S SoC | expand

Commit Message

Claudiu Beznea April 19, 2024, 8:17 a.m. UTC
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

commit bbceb13ce2c7b084bbbf2463ac8ac2b1f2bd2949 upstream.

rzg2l_cpg_sd_clk_mux_determine_rate() is the same as
__clk_mux_determine_rate_closest(), so use the latter to save some LoC.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/fed02e0325275df84e2d76f8c481e40e7023cbd9.1688760372.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/clk/renesas/rzg2l-cpg.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Pavel Machek April 21, 2024, 2:17 p.m. UTC | #1
Hi!

> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> commit bbceb13ce2c7b084bbbf2463ac8ac2b1f2bd2949 upstream.
> 
> rzg2l_cpg_sd_clk_mux_determine_rate() is the same as
> __clk_mux_determine_rate_closest(), so use the latter to save some LoC.

It is somewhat strange to use __ annotated function like this, but as
it is already mainline, I guess everything is ok.

Best regards,
								Pavel
Claudiu Beznea April 22, 2024, 5:13 a.m. UTC | #2
On 21.04.2024 17:17, Pavel Machek wrote:
> Hi!
> 
>> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>
>> commit bbceb13ce2c7b084bbbf2463ac8ac2b1f2bd2949 upstream.
>>
>> rzg2l_cpg_sd_clk_mux_determine_rate() is the same as
>> __clk_mux_determine_rate_closest(), so use the latter to save some LoC.
> 
> It is somewhat strange to use __ annotated function like this, but as

I see your point.

> it is already mainline, I guess everything is ok.
> 
> Best regards,
> 								Pavel
diff mbox series

Patch

diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index cf6337fa5e7a..43dcea9f7ed1 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -182,12 +182,6 @@  rzg2l_cpg_mux_clk_register(const struct cpg_core_clk *core,
 	return clk_hw->clk;
 }
 
-static int rzg2l_cpg_sd_clk_mux_determine_rate(struct clk_hw *hw,
-					       struct clk_rate_request *req)
-{
-	return clk_mux_determine_rate_flags(hw, req, CLK_MUX_ROUND_CLOSEST);
-}
-
 static int rzg2l_cpg_sd_clk_mux_set_parent(struct clk_hw *hw, u8 index)
 {
 	struct sd_hw_data *hwdata = to_sd_hw_data(hw);
@@ -250,7 +244,7 @@  static u8 rzg2l_cpg_sd_clk_mux_get_parent(struct clk_hw *hw)
 }
 
 static const struct clk_ops rzg2l_cpg_sd_clk_mux_ops = {
-	.determine_rate = rzg2l_cpg_sd_clk_mux_determine_rate,
+	.determine_rate = __clk_mux_determine_rate_closest,
 	.set_parent	= rzg2l_cpg_sd_clk_mux_set_parent,
 	.get_parent	= rzg2l_cpg_sd_clk_mux_get_parent,
 };