Skip to content

Commit bb67699

Browse files
masneybkhilman
authored andcommitted
ARM: OMAP2+: 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. The change to virt_prcm_set_ops had to be made manually. Signed-off-by: Brian Masney <bmasney@redhat.com> Link: https://lore.kernel.org/r/20250710-arm32-clk-round-rate-v1-2-a9146b77aca9@redhat.com Signed-off-by: Kevin Hilman <khilman@baylibre.com>
1 parent e2c0510 commit bb67699

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ static unsigned long omap2_table_mpu_recalc(struct clk_hw *clk,
7070
* Some might argue L3-DDR, others ARM, others IVA. This code is simple and
7171
* just uses the ARM rates.
7272
*/
73-
static long omap2_round_to_table_rate(struct clk_hw *hw, unsigned long rate,
74-
unsigned long *parent_rate)
73+
static int omap2_determine_rate_to_table(struct clk_hw *hw,
74+
struct clk_rate_request *req)
7575
{
7676
const struct prcm_config *ptr;
7777
long highest_rate;
@@ -87,10 +87,12 @@ static long omap2_round_to_table_rate(struct clk_hw *hw, unsigned long rate,
8787
highest_rate = ptr->mpu_speed;
8888

8989
/* Can check only after xtal frequency check */
90-
if (ptr->mpu_speed <= rate)
90+
if (ptr->mpu_speed <= req->rate)
9191
break;
9292
}
93-
return highest_rate;
93+
req->rate = highest_rate;
94+
95+
return 0;
9496
}
9597

9698
/* Sets basic clocks based on the specified rate */
@@ -215,7 +217,7 @@ static void omap2xxx_clkt_vps_late_init(void)
215217
static const struct clk_ops virt_prcm_set_ops = {
216218
.recalc_rate = &omap2_table_mpu_recalc,
217219
.set_rate = &omap2_select_table_rate,
218-
.round_rate = &omap2_round_to_table_rate,
220+
.determine_rate = &omap2_determine_rate_to_table,
219221
};
220222

221223
/**

0 commit comments

Comments
 (0)