Commit 88110a9f authored by Stefan Wahren's avatar Stefan Wahren Committed by Stephen Boyd
Browse files

clk: bcm2835: fix bcm2835_clock_choose_div



The commit 09e3b18c ("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: 09e3b18c ("clk: bcm2835: Remove unused variable")
Signed-off-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Link: https://lore.kernel.org/r/20220428183010.1635248-1-stefan.wahren@i2se.com


Tested-by: default avatarMaxime Ripard <maxime@cerno.tech>
Acked-by: default avatarMaxime Ripard <maxime@cerno.tech>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent a91b05f6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;