diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-05-29 19:53:46 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-05-29 19:53:46 +0000 |
commit | a482702706b159741e8da2ae6806d7d8254e3989 (patch) | |
tree | 44036fcb92b15b544f56973e920b530db3e9be33 | |
parent | c32e78294610dabd3dd2f86896b1c0f6d30a4491 (diff) | |
download | FreeBSD-src-a482702706b159741e8da2ae6806d7d8254e3989.zip FreeBSD-src-a482702706b159741e8da2ae6806d7d8254e3989.tar.gz |
Move the celsius-to-kelvin conversion to a place that powermac_thermal can
see it as well.
-rw-r--r-- | sys/dev/iicbus/max6690.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/dev/iicbus/max6690.c b/sys/dev/iicbus/max6690.c index 43d6c84..39275b2 100644 --- a/sys/dev/iicbus/max6690.c +++ b/sys/dev/iicbus/max6690.c @@ -329,7 +329,7 @@ max6690_sensor_read(struct max6690_sensor *sens) */ temp = (integer * 10) + (fraction >> 5) * 10 / 8; - return (temp); + return (temp + FCU_ZERO_C_TO_K); } static int @@ -338,7 +338,6 @@ max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS) device_t dev; struct max6690_softc *sc; struct max6690_sensor *sens; - int value = 0; int error; unsigned int temp; @@ -346,12 +345,10 @@ max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS) sc = device_get_softc(dev); sens = &sc->sc_sensors[arg2]; - value = max6690_sensor_read(sens); - if (value < 0) + temp = max6690_sensor_read(sens); + if (temp < 0) return (EIO); - temp = value + FCU_ZERO_C_TO_K; - error = sysctl_handle_int(oidp, &temp, 0, req); return (error); |