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

clk: spear: vco-pll: 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>

+14 -9
+14 -9
drivers/clk/spear/clk-vco-pll.c
··· 110 110 return rate; 111 111 } 112 112 113 - static long clk_pll_round_rate(struct clk_hw *hw, unsigned long drate, 114 - unsigned long *prate) 113 + static int clk_pll_determine_rate(struct clk_hw *hw, 114 + struct clk_rate_request *req) 115 115 { 116 116 int unused; 117 117 118 - return clk_pll_round_rate_index(hw, drate, prate, &unused); 118 + req->rate = clk_pll_round_rate_index(hw, req->rate, 119 + &req->best_parent_rate, &unused); 120 + 121 + return 0; 119 122 } 120 123 121 124 static unsigned long clk_pll_recalc_rate(struct clk_hw *hw, unsigned long ··· 167 164 168 165 static const struct clk_ops clk_pll_ops = { 169 166 .recalc_rate = clk_pll_recalc_rate, 170 - .round_rate = clk_pll_round_rate, 167 + .determine_rate = clk_pll_determine_rate, 171 168 .set_rate = clk_pll_set_rate, 172 169 }; 173 170 ··· 179 176 return pll_calc_rate(vco->rtbl, prate, index, NULL); 180 177 } 181 178 182 - static long clk_vco_round_rate(struct clk_hw *hw, unsigned long drate, 183 - unsigned long *prate) 179 + static int clk_vco_determine_rate(struct clk_hw *hw, 180 + struct clk_rate_request *req) 184 181 { 185 182 struct clk_vco *vco = to_clk_vco(hw); 186 183 int unused; 187 184 188 - return clk_round_rate_index(hw, drate, *prate, vco_calc_rate, 189 - vco->rtbl_cnt, &unused); 185 + req->rate = clk_round_rate_index(hw, req->rate, req->best_parent_rate, 186 + vco_calc_rate, vco->rtbl_cnt, &unused); 187 + 188 + return 0; 190 189 } 191 190 192 191 static unsigned long clk_vco_recalc_rate(struct clk_hw *hw, ··· 270 265 271 266 static const struct clk_ops clk_vco_ops = { 272 267 .recalc_rate = clk_vco_recalc_rate, 273 - .round_rate = clk_vco_round_rate, 268 + .determine_rate = clk_vco_determine_rate, 274 269 .set_rate = clk_vco_set_rate, 275 270 }; 276 271