Skip to content

Commit

Permalink
clocksource/drivers/timer-atmel-tcb: Allow selecting first divider
Browse files Browse the repository at this point in the history
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 <alexandre.belloni@bootlin.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200710230813.1005150-9-alexandre.belloni@bootlin.com
  • Loading branch information
Alexandre Belloni authored and Daniel Lezcano committed Jul 11, 2020
1 parent ef1d6a2 commit 501465d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/clocksource/timer-atmel-tcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,8 @@ static int __init tcb_clksrc_init(struct device_node *node)

tmp = rate / divisor;
pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp);
if (best_divisor_idx > 0) {
if (tmp < 5 * 1000 * 1000)
continue;
}
if ((best_divisor_idx >= 0) && (tmp < 5 * 1000 * 1000))
break;
divided_rate = tmp;
best_divisor_idx = i;
}
Expand Down

0 comments on commit 501465d

Please sign in to comment.