1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

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
This commit is contained in:
Roger Pau Monné 2016-05-04 13:48:59 +00:00
parent a7d1e7a9ec
commit 731c90b713
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299064

View File

@ -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 "