Skip to content

Commit 501465d

Browse files
alexandrebellonidlezcano
authored andcommitted
clocksource/drivers/timer-atmel-tcb: Allow selecting first divider
The divider selection algorithm never allowed to get index 0. It was also continuing to look for dividers, trying to find the slow clock selection. This is not necessary anymore. Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ef1d6a2 commit 501465d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clocksource/timer-atmel-tcb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,8 @@ static int __init tcb_clksrc_init(struct device_node *node)
432432

433433
tmp = rate / divisor;
434434
pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp);
435-
if (best_divisor_idx > 0) {
436-
if (tmp < 5 * 1000 * 1000)
437-
continue;
438-
}
435+
if ((best_divisor_idx >= 0) && (tmp < 5 * 1000 * 1000))
436+
break;
439437
divided_rate = tmp;
440438
best_divisor_idx = i;
441439
}

0 commit comments

Comments
 (0)