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

clk: mstar: msc313-cpupll: 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.

Reviewed-by: Daniel Palmer <daniel@thingy.jp>
Signed-off-by: Brian Masney <bmasney@redhat.com>

+10 -8
+10 -8
drivers/clk/mstar/clk-msc313-cpupll.c
··· 140 140 parent_rate); 141 141 } 142 142 143 - static long msc313_cpupll_round_rate(struct clk_hw *hw, unsigned long rate, 144 - unsigned long *parent_rate) 143 + static int msc313_cpupll_determine_rate(struct clk_hw *hw, 144 + struct clk_rate_request *req) 145 145 { 146 - u32 reg = msc313_cpupll_regforfrequecy(rate, *parent_rate); 147 - long rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate); 146 + u32 reg = msc313_cpupll_regforfrequecy(req->rate, req->best_parent_rate); 147 + long rounded = msc313_cpupll_frequencyforreg(reg, req->best_parent_rate); 148 148 149 149 /* 150 150 * This is my poor attempt at making sure the resulting 151 151 * rate doesn't overshoot the requested rate. 152 152 */ 153 - for (; rounded >= rate && reg > 0; reg--) 154 - rounded = msc313_cpupll_frequencyforreg(reg, *parent_rate); 153 + for (; rounded >= req->rate && reg > 0; reg--) 154 + rounded = msc313_cpupll_frequencyforreg(reg, req->best_parent_rate); 155 155 156 - return rounded; 156 + req->rate = rounded; 157 + 158 + return 0; 157 159 } 158 160 159 161 static int msc313_cpupll_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) ··· 170 168 171 169 static const struct clk_ops msc313_cpupll_ops = { 172 170 .recalc_rate = msc313_cpupll_recalc_rate, 173 - .round_rate = msc313_cpupll_round_rate, 171 + .determine_rate = msc313_cpupll_determine_rate, 174 172 .set_rate = msc313_cpupll_set_rate, 175 173 }; 176 174