Move the celsius-to-kelvin conversion to a place that powermac_thermal can

see it as well.
This commit is contained in:
Nathan Whitehorn 2011-05-29 19:53:46 +00:00
parent cbfd4d0cbc
commit 6b9a12b391

View File

@ -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);