Skip to content

Commit 619a621

Browse files
committed
clk: hisilicon: clkdivider-hi6220: 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>
1 parent 29d6d9e commit 619a621

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

drivers/clk/hisilicon/clkdivider-hi6220.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ static unsigned long hi6220_clkdiv_recalc_rate(struct clk_hw *hw,
5555
CLK_DIVIDER_ROUND_CLOSEST, dclk->width);
5656
}
5757

58-
static long hi6220_clkdiv_round_rate(struct clk_hw *hw, unsigned long rate,
59-
unsigned long *prate)
58+
static int hi6220_clkdiv_determine_rate(struct clk_hw *hw,
59+
struct clk_rate_request *req)
6060
{
6161
struct hi6220_clk_divider *dclk = to_hi6220_clk_divider(hw);
6262

63-
return divider_round_rate(hw, rate, prate, dclk->table,
64-
dclk->width, CLK_DIVIDER_ROUND_CLOSEST);
63+
req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate, dclk->table,
64+
dclk->width, CLK_DIVIDER_ROUND_CLOSEST);
65+
66+
return 0;
6567
}
6668

6769
static int hi6220_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -93,7 +95,7 @@ static int hi6220_clkdiv_set_rate(struct clk_hw *hw, unsigned long rate,
9395

9496
static const struct clk_ops hi6220_clkdiv_ops = {
9597
.recalc_rate = hi6220_clkdiv_recalc_rate,
96-
.round_rate = hi6220_clkdiv_round_rate,
98+
.determine_rate = hi6220_clkdiv_determine_rate,
9799
.set_rate = hi6220_clkdiv_set_rate,
98100
};
99101

0 commit comments

Comments
 (0)