Skip to content

Commit 88110a9

Browse files
lategoodbyebebarino
authored andcommitted
clk: bcm2835: fix bcm2835_clock_choose_div
The commit 09e3b18 ("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: 09e3b18 ("clk: bcm2835: Remove unused variable") Signed-off-by: Stefan Wahren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Maxime Ripard <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent a91b05f commit 88110a9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/clk/bcm/clk-bcm2835.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,7 @@ static u32 bcm2835_clock_choose_div(struct clk_hw *hw,
941941
u64 temp = (u64)parent_rate << CM_DIV_FRAC_BITS;
942942
u32 div, mindiv, maxdiv;
943943

944+
do_div(temp, rate);
944945
div = temp;
945946
div &= ~unused_frac_mask;
946947

0 commit comments

Comments
 (0)