Skip to content
Commit 02d7bd1e authored by Kevin Groeneveld's avatar Kevin Groeneveld Committed by Stephen Boyd
Browse files

clk: imx: pll14xx: fix recalc_rate for negative kdiv



kdiv is a signed 16 bit value in the DEV_CTL1 register. Commit
53990cf9 ("clk: imx: pll14xx: consolidate rate calculation") changed
the kdiv variable from a short int to just int. When the value read from
the DIV_CTL1 register is assigned directly to an int the sign of the value
is lost resulting in incorrect results when the value is negative. Adding
a s16 cast to the register value fixes the issue.

Fixes: 53990cf9 ("clk: imx: pll14xx: consolidate rate calculation")
Signed-off-by: default avatarKevin Groeneveld <kgroeneveld@lenbrook.com>
Link: https://lore.kernel.org/r/20221210203835.9714-1-kgroeneveld@lenbrook.com


Reviewed-by: default avatarAbel Vesa <abel.vesa@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent e45dbb81
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment