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

clk: baikal-t1: ccu-div: 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.

Signed-off-by: Brian Masney <bmasney@redhat.com>

+16 -11
+16 -11
drivers/clk/baikal-t1/ccu-div.c
··· 228 228 CCU_DIV_CLKDIV_MAX(mask)); 229 229 } 230 230 231 - static long ccu_div_var_round_rate(struct clk_hw *hw, unsigned long rate, 232 - unsigned long *parent_rate) 231 + static int ccu_div_var_determine_rate(struct clk_hw *hw, 232 + struct clk_rate_request *req) 233 233 { 234 234 struct ccu_div *div = to_ccu_div(hw); 235 235 unsigned long divider; 236 236 237 - divider = ccu_div_var_calc_divider(rate, *parent_rate, div->mask); 237 + divider = ccu_div_var_calc_divider(req->rate, req->best_parent_rate, 238 + div->mask); 238 239 239 - return ccu_div_calc_freq(*parent_rate, divider); 240 + req->rate = ccu_div_calc_freq(req->best_parent_rate, divider); 241 + 242 + return 0; 240 243 } 241 244 242 245 /* ··· 311 308 return ccu_div_calc_freq(parent_rate, div->divider); 312 309 } 313 310 314 - static long ccu_div_fixed_round_rate(struct clk_hw *hw, unsigned long rate, 315 - unsigned long *parent_rate) 311 + static int ccu_div_fixed_determine_rate(struct clk_hw *hw, 312 + struct clk_rate_request *req) 316 313 { 317 314 struct ccu_div *div = to_ccu_div(hw); 318 315 319 - return ccu_div_calc_freq(*parent_rate, div->divider); 316 + req->rate = ccu_div_calc_freq(req->best_parent_rate, div->divider); 317 + 318 + return 0; 320 319 } 321 320 322 321 static int ccu_div_fixed_set_rate(struct clk_hw *hw, unsigned long rate, ··· 539 534 .disable = ccu_div_gate_disable, 540 535 .is_enabled = ccu_div_gate_is_enabled, 541 536 .recalc_rate = ccu_div_var_recalc_rate, 542 - .round_rate = ccu_div_var_round_rate, 537 + .determine_rate = ccu_div_var_determine_rate, 543 538 .set_rate = ccu_div_var_set_rate_fast, 544 539 .debug_init = ccu_div_var_debug_init 545 540 }; 546 541 547 542 static const struct clk_ops ccu_div_var_nogate_ops = { 548 543 .recalc_rate = ccu_div_var_recalc_rate, 549 - .round_rate = ccu_div_var_round_rate, 544 + .determine_rate = ccu_div_var_determine_rate, 550 545 .set_rate = ccu_div_var_set_rate_slow, 551 546 .debug_init = ccu_div_var_debug_init 552 547 }; ··· 556 551 .disable = ccu_div_gate_disable, 557 552 .is_enabled = ccu_div_gate_is_enabled, 558 553 .recalc_rate = ccu_div_fixed_recalc_rate, 559 - .round_rate = ccu_div_fixed_round_rate, 554 + .determine_rate = ccu_div_fixed_determine_rate, 560 555 .set_rate = ccu_div_fixed_set_rate, 561 556 .debug_init = ccu_div_gate_debug_init 562 557 }; ··· 570 565 571 566 static const struct clk_ops ccu_div_fixed_ops = { 572 567 .recalc_rate = ccu_div_fixed_recalc_rate, 573 - .round_rate = ccu_div_fixed_round_rate, 568 + .determine_rate = ccu_div_fixed_determine_rate, 574 569 .set_rate = ccu_div_fixed_set_rate, 575 570 .debug_init = ccu_div_fixed_debug_init 576 571 };