diff options
author | royger <royger@FreeBSD.org> | 2016-05-04 13:48:59 +0000 |
---|---|---|
committer | royger <royger@FreeBSD.org> | 2016-05-04 13:48:59 +0000 |
commit | 9610d15b516e3ce2c945ea59ca9bb13e9f50bad0 (patch) | |
tree | eb21ea2c39a64772f5afdd40696654a682143539 /sys/kern/subr_rtc.c | |
parent | 2419ffe0931643f0534ce66621db40f331bcede4 (diff) | |
download | FreeBSD-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.c | 2 |
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 " |