Commit 501465d5 authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Daniel Lezcano

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: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200710230813.1005150-9-alexandre.belloni@bootlin.com
parent ef1d6a20
...@@ -432,10 +432,8 @@ static int __init tcb_clksrc_init(struct device_node *node) ...@@ -432,10 +432,8 @@ static int __init tcb_clksrc_init(struct device_node *node)
tmp = rate / divisor; tmp = rate / divisor;
pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp); pr_debug("TC: %u / %-3u [%d] --> %u\n", rate, divisor, i, tmp);
if (best_divisor_idx > 0) { if ((best_divisor_idx >= 0) && (tmp < 5 * 1000 * 1000))
if (tmp < 5 * 1000 * 1000) break;
continue;
}
divided_rate = tmp; divided_rate = tmp;
best_divisor_idx = i; best_divisor_idx = i;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment