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

clk: gemini: 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: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Brian Masney <bmasney@redhat.com>

+9 -6
+9 -6
drivers/clk/clk-gemini.c
··· 126 126 return 33000000; 127 127 } 128 128 129 - static long gemini_pci_round_rate(struct clk_hw *hw, unsigned long rate, 130 - unsigned long *prate) 129 + static int gemini_pci_determine_rate(struct clk_hw *hw, 130 + struct clk_rate_request *req) 131 131 { 132 132 /* We support 33 and 66 MHz */ 133 - if (rate < 48000000) 134 - return 33000000; 135 - return 66000000; 133 + if (req->rate < 48000000) 134 + req->rate = 33000000; 135 + else 136 + req->rate = 66000000; 137 + 138 + return 0; 136 139 } 137 140 138 141 static int gemini_pci_set_rate(struct clk_hw *hw, unsigned long rate, ··· 182 179 183 180 static const struct clk_ops gemini_pci_clk_ops = { 184 181 .recalc_rate = gemini_pci_recalc_rate, 185 - .round_rate = gemini_pci_round_rate, 182 + .determine_rate = gemini_pci_determine_rate, 186 183 .set_rate = gemini_pci_set_rate, 187 184 .enable = gemini_pci_enable, 188 185 .disable = gemini_pci_disable,