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

clk: cdce706: 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 -7
+9 -7
drivers/clk/clk-cdce706.c
··· 183 183 return 0; 184 184 } 185 185 186 - static long cdce706_pll_round_rate(struct clk_hw *hw, unsigned long rate, 187 - unsigned long *parent_rate) 186 + static int cdce706_pll_determine_rate(struct clk_hw *hw, 187 + struct clk_rate_request *req) 188 188 { 189 189 struct cdce706_hw_data *hwd = to_hw_data(hw); 190 190 unsigned long mul, div; ··· 192 192 193 193 dev_dbg(&hwd->dev_data->client->dev, 194 194 "%s, rate: %lu, parent_rate: %lu\n", 195 - __func__, rate, *parent_rate); 195 + __func__, req->rate, req->best_parent_rate); 196 196 197 - rational_best_approximation(rate, *parent_rate, 197 + rational_best_approximation(req->rate, req->best_parent_rate, 198 198 CDCE706_PLL_N_MAX, CDCE706_PLL_M_MAX, 199 199 &mul, &div); 200 200 hwd->mul = mul; ··· 204 204 "%s, pll: %d, mul: %lu, div: %lu\n", 205 205 __func__, hwd->idx, mul, div); 206 206 207 - res = (u64)*parent_rate * hwd->mul; 207 + res = (u64)req->best_parent_rate * hwd->mul; 208 208 do_div(res, hwd->div); 209 - return res; 209 + req->rate = res; 210 + 211 + return 0; 210 212 } 211 213 212 214 static int cdce706_pll_set_rate(struct clk_hw *hw, unsigned long rate, ··· 253 251 254 252 static const struct clk_ops cdce706_pll_ops = { 255 253 .recalc_rate = cdce706_pll_recalc_rate, 256 - .round_rate = cdce706_pll_round_rate, 254 + .determine_rate = cdce706_pll_determine_rate, 257 255 .set_rate = cdce706_pll_set_rate, 258 256 }; 259 257