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

clk: cs2000-cp: 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>

+9 -5
+9 -5
drivers/clk/clk-cs2000-cp.c
··· 305 305 return cs2000_ratio_to_rate(ratio, parent_rate, priv->lf_ratio); 306 306 } 307 307 308 - static long cs2000_round_rate(struct clk_hw *hw, unsigned long rate, 309 - unsigned long *parent_rate) 308 + static int cs2000_determine_rate(struct clk_hw *hw, 309 + struct clk_rate_request *req) 310 310 { 311 311 struct cs2000_priv *priv = hw_to_priv(hw); 312 312 u32 ratio; 313 313 314 - ratio = cs2000_rate_to_ratio(*parent_rate, rate, priv->lf_ratio); 314 + ratio = cs2000_rate_to_ratio(req->best_parent_rate, req->rate, 315 + priv->lf_ratio); 315 316 316 - return cs2000_ratio_to_rate(ratio, *parent_rate, priv->lf_ratio); 317 + req->rate = cs2000_ratio_to_rate(ratio, req->best_parent_rate, 318 + priv->lf_ratio); 319 + 320 + return 0; 317 321 } 318 322 319 323 static int cs2000_select_ratio_mode(struct cs2000_priv *priv, ··· 434 430 static const struct clk_ops cs2000_ops = { 435 431 .get_parent = cs2000_get_parent, 436 432 .recalc_rate = cs2000_recalc_rate, 437 - .round_rate = cs2000_round_rate, 433 + .determine_rate = cs2000_determine_rate, 438 434 .set_rate = cs2000_set_rate, 439 435 .prepare = cs2000_enable, 440 436 .unprepare = cs2000_disable,