Skip to content

Commit e20c5ab

Browse files
committed
clk: rockchip: half-divider: 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 0879768 commit e20c5ab

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

drivers/clk/rockchip/clk-half-divider.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,19 @@ static int clk_half_divider_bestdiv(struct clk_hw *hw, unsigned long rate,
9292
return bestdiv;
9393
}
9494

95-
static long clk_half_divider_round_rate(struct clk_hw *hw, unsigned long rate,
96-
unsigned long *prate)
95+
static int clk_half_divider_determine_rate(struct clk_hw *hw,
96+
struct clk_rate_request *req)
9797
{
9898
struct clk_divider *divider = to_clk_divider(hw);
9999
int div;
100100

101-
div = clk_half_divider_bestdiv(hw, rate, prate,
101+
div = clk_half_divider_bestdiv(hw, req->rate, &req->best_parent_rate,
102102
divider->width,
103103
divider->flags);
104104

105-
return DIV_ROUND_UP_ULL(((u64)*prate * 2), div * 2 + 3);
105+
req->rate = DIV_ROUND_UP_ULL(((u64)req->best_parent_rate * 2), div * 2 + 3);
106+
107+
return 0;
106108
}
107109

108110
static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -141,7 +143,7 @@ static int clk_half_divider_set_rate(struct clk_hw *hw, unsigned long rate,
141143

142144
static const struct clk_ops clk_half_divider_ops = {
143145
.recalc_rate = clk_half_divider_recalc_rate,
144-
.round_rate = clk_half_divider_round_rate,
146+
.determine_rate = clk_half_divider_determine_rate,
145147
.set_rate = clk_half_divider_set_rate,
146148
};
147149

0 commit comments

Comments
 (0)