Commit 775e9653 authored by Brian Masney's avatar Brian Masney
Browse files

clk: versatile: vexpress-osc: 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 avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
parent ef6fd5ce
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -33,18 +33,18 @@ static unsigned long vexpress_osc_recalc_rate(struct clk_hw *hw,
	return rate;
}

static long vexpress_osc_round_rate(struct clk_hw *hw, unsigned long rate,
		unsigned long *parent_rate)
static int vexpress_osc_determine_rate(struct clk_hw *hw,
				       struct clk_rate_request *req)
{
	struct vexpress_osc *osc = to_vexpress_osc(hw);

	if (osc->rate_min && rate < osc->rate_min)
		rate = osc->rate_min;
	if (osc->rate_min && req->rate < osc->rate_min)
		req->rate = osc->rate_min;

	if (osc->rate_max && rate > osc->rate_max)
		rate = osc->rate_max;
	if (osc->rate_max && req->rate > osc->rate_max)
		req->rate = osc->rate_max;

	return rate;
	return 0;
}

static int vexpress_osc_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -57,7 +57,7 @@ static int vexpress_osc_set_rate(struct clk_hw *hw, unsigned long rate,

static const struct clk_ops vexpress_osc_ops = {
	.recalc_rate = vexpress_osc_recalc_rate,
	.round_rate = vexpress_osc_round_rate,
	.determine_rate = vexpress_osc_determine_rate,
	.set_rate = vexpress_osc_set_rate,
};