diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2022-04-28 21:30:10 +0300 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2022-05-17 10:00:34 +0300 |
commit | 88110a9f6209be1ed7312bae029d000bc7c7e88f (patch) | |
tree | f3133501885827dd017a84ad41c1c211877fc78e /drivers/clk/bcm | |
parent | a91b05f6b928e8fab750fc953d7df0aa6dc43547 (diff) | |
download | linux-88110a9f6209be1ed7312bae029d000bc7c7e88f.tar.xz |
clk: bcm2835: fix bcm2835_clock_choose_div
The commit 09e3b18ca5de ("clk: bcm2835: Remove unused variable")
accidentially breaks the behavior of bcm2835_clock_choose_div() and
booting of Raspberry Pi. The removed do_div macro call had side effects,
so we need to restore it.
Fixes: 09e3b18ca5de ("clk: bcm2835: Remove unused variable")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/20220428183010.1635248-1-stefan.wahren@i2se.com
Tested-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/bcm')
-rw-r--r-- | drivers/clk/bcm/clk-bcm2835.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 3ad20e75fd23..48a1eb9f2d55 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -941,6 +941,7 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw, u64 temp = (u64)parent_rate << CM_DIV_FRAC_BITS; u32 div, mindiv, maxdiv; + do_div(temp, rate); div = temp; div &= ~unused_frac_mask; |