Commit 8672b18c authored by Brian Masney's avatar Brian Masney Committed by Greg Kroah-Hartman
Browse files

tty: serial: mvebu-uart: 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
appended to the "under-the-cut" portion of the patch.

Signed-off-by: default avatarBrian Masney <bmasney@redhat.com>
Link: https://lore.kernel.org/r/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd673d2b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1264,14 +1264,16 @@ static unsigned long mvebu_uart_clock_recalc_rate(struct clk_hw *hw,
	return parent_rate / uart_clock_base->div;
}

static long mvebu_uart_clock_round_rate(struct clk_hw *hw, unsigned long rate,
					unsigned long *parent_rate)
static int mvebu_uart_clock_determine_rate(struct clk_hw *hw,
					   struct clk_rate_request *req)
{
	struct mvebu_uart_clock *uart_clock = to_uart_clock(hw);
	struct mvebu_uart_clock_base *uart_clock_base =
						to_uart_clock_base(uart_clock);

	return *parent_rate / uart_clock_base->div;
	req->rate = req->best_parent_rate / uart_clock_base->div;

	return 0;
}

static int mvebu_uart_clock_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -1293,7 +1295,7 @@ static const struct clk_ops mvebu_uart_clock_ops = {
	.is_enabled = mvebu_uart_clock_is_enabled,
	.save_context = mvebu_uart_clock_save_context,
	.restore_context = mvebu_uart_clock_restore_context,
	.round_rate = mvebu_uart_clock_round_rate,
	.determine_rate = mvebu_uart_clock_determine_rate,
	.set_rate = mvebu_uart_clock_set_rate,
	.recalc_rate = mvebu_uart_clock_recalc_rate,
};