mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
clk: st: clkgen-fsyn: 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>
This commit is contained in:
@@ -375,22 +375,21 @@ static int clk_fs660c32_vco_get_params(unsigned long input,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long quadfs_pll_fs660c32_round_rate(struct clk_hw *hw,
|
||||
unsigned long rate,
|
||||
unsigned long *prate)
|
||||
static int quadfs_pll_fs660c32_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
struct stm_fs params;
|
||||
|
||||
if (clk_fs660c32_vco_get_params(*prate, rate, ¶ms))
|
||||
return rate;
|
||||
if (clk_fs660c32_vco_get_params(req->best_parent_rate, req->rate, ¶ms))
|
||||
return 0;
|
||||
|
||||
clk_fs660c32_vco_get_rate(*prate, ¶ms, &rate);
|
||||
clk_fs660c32_vco_get_rate(req->best_parent_rate, ¶ms, &req->rate);
|
||||
|
||||
pr_debug("%s: %s new rate %ld [ndiv=%u]\n",
|
||||
__func__, clk_hw_get_name(hw),
|
||||
rate, (unsigned int)params.ndiv);
|
||||
req->rate, (unsigned int)params.ndiv);
|
||||
|
||||
return rate;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int quadfs_pll_fs660c32_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
@@ -436,7 +435,7 @@ static const struct clk_ops st_quadfs_pll_c32_ops = {
|
||||
.disable = quadfs_pll_disable,
|
||||
.is_enabled = quadfs_pll_is_enabled,
|
||||
.recalc_rate = quadfs_pll_fs660c32_recalc_rate,
|
||||
.round_rate = quadfs_pll_fs660c32_round_rate,
|
||||
.determine_rate = quadfs_pll_fs660c32_determine_rate,
|
||||
.set_rate = quadfs_pll_fs660c32_set_rate,
|
||||
};
|
||||
|
||||
@@ -814,19 +813,21 @@ static unsigned long quadfs_recalc_rate(struct clk_hw *hw,
|
||||
return rate;
|
||||
}
|
||||
|
||||
static long quadfs_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *prate)
|
||||
static int quadfs_determine_rate(struct clk_hw *hw,
|
||||
struct clk_rate_request *req)
|
||||
{
|
||||
struct stm_fs params;
|
||||
|
||||
rate = quadfs_find_best_rate(hw, rate, *prate, ¶ms);
|
||||
req->rate = quadfs_find_best_rate(hw, req->rate,
|
||||
req->best_parent_rate, ¶ms);
|
||||
|
||||
pr_debug("%s: %s new rate %ld [sdiv=0x%x,md=0x%x,pe=0x%x,nsdiv3=%u]\n",
|
||||
__func__, clk_hw_get_name(hw),
|
||||
rate, (unsigned int)params.sdiv, (unsigned int)params.mdiv,
|
||||
(unsigned int)params.pe, (unsigned int)params.nsdiv);
|
||||
req->rate, (unsigned int)params.sdiv,
|
||||
(unsigned int)params.mdiv,
|
||||
(unsigned int)params.pe, (unsigned int)params.nsdiv);
|
||||
|
||||
return rate;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -873,7 +874,7 @@ static const struct clk_ops st_quadfs_ops = {
|
||||
.enable = quadfs_fsynth_enable,
|
||||
.disable = quadfs_fsynth_disable,
|
||||
.is_enabled = quadfs_fsynth_is_enabled,
|
||||
.round_rate = quadfs_round_rate,
|
||||
.determine_rate = quadfs_determine_rate,
|
||||
.set_rate = quadfs_set_rate,
|
||||
.recalc_rate = quadfs_recalc_rate,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user