summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_rtc.c
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2016-05-04 13:48:59 +0000
committerroyger <royger@FreeBSD.org>2016-05-04 13:48:59 +0000
commit9610d15b516e3ce2c945ea59ca9bb13e9f50bad0 (patch)
treeeb21ea2c39a64772f5afdd40696654a682143539 /sys/kern/subr_rtc.c
parent2419ffe0931643f0534ce66621db40f331bcede4 (diff)
downloadFreeBSD-src-9610d15b516e3ce2c945ea59ca9bb13e9f50bad0.zip
FreeBSD-src-9610d15b516e3ce2c945ea59ca9bb13e9f50bad0.tar.gz
rtc: fix inverted resolution check
The current code in clock_register checks if the newly added clock has a resolution value higher than the current one in order to make it the default, which is wrong. Clocks with a lower resolution value should be better than ones with a higher resolution value, in fact with the current code FreeBSD is always selecting the worse clock. Reviewed by: kib jhb jkim Sponsored by: Citrix Systems R&D MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D6185
Diffstat (limited to 'sys/kern/subr_rtc.c')
-rw-r--r--sys/kern/subr_rtc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_rtc.c b/sys/kern/subr_rtc.c
index ed2befc..5d4167d 100644
--- a/sys/kern/subr_rtc.c
+++ b/sys/kern/subr_rtc.c
@@ -84,7 +84,7 @@ clock_register(device_t dev, long res) /* res has units of microseconds */
{
if (clock_dev != NULL) {
- if (clock_res > res) {
+ if (clock_res <= res) {
if (bootverbose)
device_printf(dev, "not installed as "
"time-of-day clock: clock %s has higher "
OpenPOWER on IntegriCloud