Skip to content

Commit e2c0510

Browse files
masneybkhilman
authored andcommitted
ARM: OMAP1: clock: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from round_rate() to determine_rate() using the Coccinelle semantic patch on the cover letter of this series. Signed-off-by: Brian Masney <bmasney@redhat.com> Acked-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Link: https://lore.kernel.org/r/20250710-arm32-clk-round-rate-v1-1-a9146b77aca9@redhat.com Signed-off-by: Kevin Hilman <khilman@baylibre.com>
1 parent 21e2e1a commit e2c0510

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

arch/arm/mach-omap1/clock.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,21 @@ static unsigned long omap1_clk_recalc_rate(struct clk_hw *hw, unsigned long p_ra
705705
return clk->rate;
706706
}
707707

708-
static long omap1_clk_round_rate(struct clk_hw *hw, unsigned long rate, unsigned long *p_rate)
708+
static int omap1_clk_determine_rate(struct clk_hw *hw,
709+
struct clk_rate_request *req)
709710
{
710711
struct omap1_clk *clk = to_omap1_clk(hw);
711712

712-
if (clk->round_rate != NULL)
713-
return clk->round_rate(clk, rate, p_rate);
713+
if (clk->round_rate != NULL) {
714+
req->rate = clk->round_rate(clk, req->rate,
715+
&req->best_parent_rate);
714716

715-
return omap1_clk_recalc_rate(hw, *p_rate);
717+
return 0;
718+
}
719+
720+
req->rate = omap1_clk_recalc_rate(hw, req->best_parent_rate);
721+
722+
return 0;
716723
}
717724

718725
static int omap1_clk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long p_rate)
@@ -771,7 +778,7 @@ const struct clk_ops omap1_clk_gate_ops = {
771778

772779
const struct clk_ops omap1_clk_rate_ops = {
773780
.recalc_rate = omap1_clk_recalc_rate,
774-
.round_rate = omap1_clk_round_rate,
781+
.determine_rate = omap1_clk_determine_rate,
775782
.set_rate = omap1_clk_set_rate,
776783
.init = omap1_clk_init_op,
777784
};
@@ -784,7 +791,7 @@ const struct clk_ops omap1_clk_full_ops = {
784791
.disable_unused = omap1_clk_disable_unused,
785792
#endif
786793
.recalc_rate = omap1_clk_recalc_rate,
787-
.round_rate = omap1_clk_round_rate,
794+
.determine_rate = omap1_clk_determine_rate,
788795
.set_rate = omap1_clk_set_rate,
789796
.init = omap1_clk_init_op,
790797
};

0 commit comments

Comments
 (0)