Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 May 2011 19:53:46 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222461 - head/sys/dev/iicbus
Message-ID:  <201105291953.p4TJrkAt044120@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sun May 29 19:53:46 2011
New Revision: 222461
URL: http://svn.freebsd.org/changeset/base/222461

Log:
  Move the celsius-to-kelvin conversion to a place that powermac_thermal can
  see it as well.

Modified:
  head/sys/dev/iicbus/max6690.c

Modified: head/sys/dev/iicbus/max6690.c
==============================================================================
--- head/sys/dev/iicbus/max6690.c	Sun May 29 19:53:11 2011	(r222460)
+++ head/sys/dev/iicbus/max6690.c	Sun May 29 19:53:46 2011	(r222461)
@@ -329,7 +329,7 @@ max6690_sensor_read(struct max6690_senso
 	*/
 	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_ARG
 	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_ARG
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105291953.p4TJrkAt044120>