clk: sprd: div: 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.

Reviewed-by: Chunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
Brian Masney
2025-08-11 11:18:45 -04:00
parent 19271e0d45
commit deb4740a5f

View File

@@ -9,13 +9,16 @@
#include "div.h"
static long sprd_div_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate)
static int sprd_div_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct sprd_div *cd = hw_to_sprd_div(hw);
return divider_round_rate(&cd->common.hw, rate, parent_rate, NULL,
cd->div.width, 0);
req->rate = divider_round_rate(&cd->common.hw, req->rate,
&req->best_parent_rate,
NULL, cd->div.width, 0);
return 0;
}
unsigned long sprd_div_helper_recalc_rate(struct sprd_clk_common *common,
@@ -75,7 +78,7 @@ static int sprd_div_set_rate(struct clk_hw *hw, unsigned long rate,
const struct clk_ops sprd_div_ops = {
.recalc_rate = sprd_div_recalc_rate,
.round_rate = sprd_div_round_rate,
.determine_rate = sprd_div_determine_rate,
.set_rate = sprd_div_set_rate,
};
EXPORT_SYMBOL_GPL(sprd_div_ops);