From 6b9a12b391fc99de9f5ce72d83e42c88a4a44dea Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Sun, 29 May 2011 19:53:46 +0000 Subject: [PATCH] Move the celsius-to-kelvin conversion to a place that powermac_thermal can see it as well. --- sys/dev/iicbus/max6690.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/iicbus/max6690.c b/sys/dev/iicbus/max6690.c index 43d6c8487385..39275b2921e4 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);