]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
htu21: don't needlessly bother hardware when measurements are not needed
authorAndriy Gapon <avg@FreeBSD.org>
Sat, 6 Nov 2021 16:47:32 +0000 (18:47 +0200)
committerAndriy Gapon <avg@FreeBSD.org>
Sat, 6 Nov 2021 17:39:52 +0000 (19:39 +0200)
commit43b031a371eb90c15c390c26202f5f58d09300ef
tree6b873af30ca63c968da0844e7baa15b51a9f0a27
parentc01a46d4acab923961dfb7e4605b9ca6e775e616
htu21: don't needlessly bother hardware when measurements are not needed

sysctl(8) first queries a sysctl to get a size of its value even if the
sysctl is of a fixed size, e.g. it has an integer type.
Only after that sysctl(8) queries an actual value of the sysctl.

Previosuly the driver would needlessly read a sensor in the first step.

MFC after: 1 week
sys/dev/iicbus/htu21.c