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

Configure Feed

Select the types of activity you want to include in your feed.

clk: composite: convert from round_rate() to determine_rate()

The round_rate() clk ops is deprecated and going away, so migrate
this driver from round_rate() to determine_rate().

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

+5 -33
+5 -33
drivers/clk/clk-composite.c
··· 47 47 struct clk_hw *parent_hw, 48 48 const struct clk_ops *rate_ops) 49 49 { 50 - long rate; 51 - 52 50 req->best_parent_hw = parent_hw; 53 51 req->best_parent_rate = clk_hw_get_rate(parent_hw); 54 52 55 - if (rate_ops->determine_rate) 56 - return rate_ops->determine_rate(rate_hw, req); 57 - 58 - rate = rate_ops->round_rate(rate_hw, req->rate, 59 - &req->best_parent_rate); 60 - if (rate < 0) 61 - return rate; 62 - 63 - req->rate = rate; 64 - 65 - return 0; 53 + return rate_ops->determine_rate(rate_hw, req); 66 54 } 67 55 68 56 static int clk_composite_determine_rate(struct clk_hw *hw, ··· 67 79 unsigned long best_rate = 0; 68 80 int i, ret; 69 81 70 - if (rate_hw && rate_ops && 71 - (rate_ops->determine_rate || rate_ops->round_rate) && 82 + if (rate_hw && rate_ops && rate_ops->determine_rate && 72 83 mux_hw && mux_ops && mux_ops->set_parent) { 73 84 req->best_parent_hw = NULL; 74 85 ··· 135 148 pr_err("clk: clk_composite_determine_rate function called, but no mux or rate callback set!\n"); 136 149 return -EINVAL; 137 150 } 138 - } 139 - 140 - static long clk_composite_round_rate(struct clk_hw *hw, unsigned long rate, 141 - unsigned long *prate) 142 - { 143 - struct clk_composite *composite = to_clk_composite(hw); 144 - const struct clk_ops *rate_ops = composite->rate_ops; 145 - struct clk_hw *rate_hw = composite->rate_hw; 146 - 147 - __clk_hw_set_clk(rate_hw, hw); 148 - 149 - return rate_ops->round_rate(rate_hw, rate, prate); 150 151 } 151 152 152 153 static int clk_composite_set_rate(struct clk_hw *hw, unsigned long rate, ··· 263 288 if (rate_ops->determine_rate) 264 289 clk_composite_ops->determine_rate = 265 290 clk_composite_determine_rate; 266 - else if (rate_ops->round_rate) 267 - clk_composite_ops->round_rate = 268 - clk_composite_round_rate; 269 291 270 - /* .set_rate requires either .round_rate or .determine_rate */ 292 + /* .set_rate requires .determine_rate */ 271 293 if (rate_ops->set_rate) { 272 - if (rate_ops->determine_rate || rate_ops->round_rate) 294 + if (rate_ops->determine_rate) 273 295 clk_composite_ops->set_rate = 274 296 clk_composite_set_rate; 275 297 else 276 - WARN(1, "%s: missing round_rate op is required\n", 298 + WARN(1, "%s: missing determine_rate op is required\n", 277 299 __func__); 278 300 } 279 301