]> git.baikalelectronics.ru Git - kernel.git/commit
clk: sunxi: Fix incorrect usage of round_down()
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Tue, 17 Mar 2020 21:13:32 +0000 (22:13 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Tue, 14 Apr 2020 07:21:05 +0000 (09:21 +0200)
commit4cb732e4ca2165763f246d3750579a99b81f6454
tree098aea8ea5ab5b50c2a9a81b9bf80bcb2a64a3c5
parent9b8057e7f937f20763a90a8fc2333168af101732
clk: sunxi: Fix incorrect usage of round_down()

round_down() can only round to powers of 2. If round_down() is asked
to round to something that is not a power of 2, incorrect results are
produced. The incorrect results can be both too large and too small.

Instead, use rounddown() which can round to any number.

Fixes: 335bade4e860 ("clk: sunxi: Add A31 clocks support")
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/clk/sunxi/clk-sunxi.c