]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tty: serial: mvebu-uart: convert from round_rate() to determine_rate()
authorBrian Masney <bmasney@redhat.com>
Sun, 10 Aug 2025 22:14:25 +0000 (18:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Aug 2025 09:59:04 +0000 (11:59 +0200)
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>
drivers/tty/serial/mvebu-uart.c

index 5de57b77abdb03f2fd46b2dc7f9bf7f00c34c15e..8e52be2b34ea20634bf45c26773728af1e5e150e 100644 (file)
@@ -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,
 };