Commit 81c438b5 authored by Brian Masney's avatar Brian Masney
Browse files

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: default avatarGabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
parent cd1cb388
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -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,

};