clk: stm32: stm32mp1: 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: Gabriel Fernandez <gabriel.fernandez@foss.st.com> Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
parent
cd1cb38836
commit
81c438b53b
1 changed files with 8 additions and 5 deletions
|
|
@ -970,12 +970,15 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
|
|||
return mult;
|
||||
}
|
||||
|
||||
static long timer_ker_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *parent_rate)
|
||||
static int timer_ker_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
unsigned long factor = __bestmult(hw, rate, *parent_rate);
|
||||
unsigned long factor = __bestmult(hw, req->rate,
|
||||
req->best_parent_rate);
|
||||
|
||||
return *parent_rate * factor;
|
||||
req->rate = req->best_parent_rate * factor;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int timer_ker_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
|
|
@ -1026,7 +1029,7 @@ static unsigned long timer_ker_recalc_rate(struct clk_hw *hw,
|
|||
|
||||
static const struct clk_ops timer_ker_ops = {
|
||||
.recalc_rate = timer_ker_recalc_rate,
|
||||
.round_rate = timer_ker_round_rate,
|
||||
.determine_rate = timer_ker_determine_rate,
|
||||
.set_rate = timer_ker_set_rate,
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue