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: Brian Masney <bmasney@redhat.com> Link: https://lore.kernel.org/r/20250810-tty-round-rate-v1-1-849009f3bdfd@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bd673d2b71
commit
8672b18cde
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user