Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Brian Masney and committed by
Greg Kroah-Hartman
8672b18c bd673d2b

+6 -4
+6 -4
drivers/tty/serial/mvebu-uart.c
··· 1264 1264 return parent_rate / uart_clock_base->div; 1265 1265 } 1266 1266 1267 - static long mvebu_uart_clock_round_rate(struct clk_hw *hw, unsigned long rate, 1268 - unsigned long *parent_rate) 1267 + static int mvebu_uart_clock_determine_rate(struct clk_hw *hw, 1268 + struct clk_rate_request *req) 1269 1269 { 1270 1270 struct mvebu_uart_clock *uart_clock = to_uart_clock(hw); 1271 1271 struct mvebu_uart_clock_base *uart_clock_base = 1272 1272 to_uart_clock_base(uart_clock); 1273 1273 1274 - return *parent_rate / uart_clock_base->div; 1274 + req->rate = req->best_parent_rate / uart_clock_base->div; 1275 + 1276 + return 0; 1275 1277 } 1276 1278 1277 1279 static int mvebu_uart_clock_set_rate(struct clk_hw *hw, unsigned long rate, ··· 1295 1293 .is_enabled = mvebu_uart_clock_is_enabled, 1296 1294 .save_context = mvebu_uart_clock_save_context, 1297 1295 .restore_context = mvebu_uart_clock_restore_context, 1298 - .round_rate = mvebu_uart_clock_round_rate, 1296 + .determine_rate = mvebu_uart_clock_determine_rate, 1299 1297 .set_rate = mvebu_uart_clock_set_rate, 1300 1298 .recalc_rate = mvebu_uart_clock_recalc_rate, 1301 1299 };