diff options
author | Kevin Groeneveld <kgroeneveld@lenbrook.com> | 2022-12-10 23:38:35 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-02-21 20:34:36 +0300 |
commit | 02d7bd1efb4280ea1a75ad1eece3f19537f82a19 (patch) | |
tree | ad67867541b176b27a3b9907f7bca8e73997cbc7 /drivers/clk/imx/clk-imx8mn.c | |
parent | e45dbb81b3953089e048ab4aa2c89aedfb126053 (diff) | |
download | linux-02d7bd1efb4280ea1a75ad1eece3f19537f82a19.tar.xz |
clk: imx: pll14xx: fix recalc_rate for negative kdiv
kdiv is a signed 16 bit value in the DEV_CTL1 register. Commit
53990cf9d5b4 ("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: 53990cf9d5b4 ("clk: imx: pll14xx: consolidate rate calculation")
Signed-off-by: Kevin Groeneveld <kgroeneveld@lenbrook.com>
Link: https://lore.kernel.org/r/20221210203835.9714-1-kgroeneveld@lenbrook.com
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/imx/clk-imx8mn.c')
0 files changed, 0 insertions, 0 deletions