Skip to content

Commit af94366

Browse files
committed
clk: nxp: lpc32xx: convert from divider_round_rate() to divider_determine_rate()
The divider_round_rate() function is now deprecated, so let's migrate to divider_determine_rate() instead so that this deprecated API can be removed. Note that when the main function itself was migrated to use determine_rate, this was mistakenly converted to: req->rate = divider_round_rate(...) This is invalid in the case when an error occurs since it can set the rate to a negative value. Fixes: 0879768 ("clk: nxp: lpc32xx: convert from round_rate() to determine_rate()") Tested-by: Vladimir Zapolskiy <vz@mleia.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Brian Masney <bmasney@redhat.com>
1 parent 9329d78 commit af94366

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/clk/nxp/clk-lpc32xx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,8 @@ static int clk_divider_determine_rate(struct clk_hw *hw,
975975
return 0;
976976
}
977977

978-
req->rate = divider_round_rate(hw, req->rate, &req->best_parent_rate,
979-
divider->table, divider->width, divider->flags);
980-
981-
return 0;
978+
return divider_determine_rate(hw, req, divider->table, divider->width,
979+
divider->flags);
982980
}
983981

984982
static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,

0 commit comments

Comments
 (0)