Skip to content

Commit 0ef99f8

Browse files
claudiubezneabebarino
authored andcommitted
clk: at91: clk-master: fix prescaler logic
When prescaler value read from register is MASTER_PRES_MAX it means that the input clock will be divided by 3. Fix the code to reflect this. Fixes: 7a110b9 ("clk: at91: clk-master: re-factor master clock") Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent a27748a commit 0ef99f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/at91/clk-master.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ static unsigned long clk_master_pres_recalc_rate(struct clk_hw *hw,
386386

387387
val &= master->layout->mask;
388388
pres = (val >> master->layout->pres_shift) & MASTER_PRES_MASK;
389-
if (pres == 3 && characteristics->have_div3_pres)
389+
if (pres == MASTER_PRES_MAX && characteristics->have_div3_pres)
390390
pres = 3;
391391
else
392392
pres = (1 << pres);

0 commit comments

Comments
 (0)