[PATCH] I2C update for 2.6.5

Greg KH greg at kroah.com
Thu Apr 15 00:24:14 CEST 2004


ChangeSet 1.1643.36.30, 2004/04/14 13:10:38-07:00, khali at linux-fr.org

[PATCH] I2C: Fix voltage rounding in asb100

This one line patch fixes voltage rounding in the asb100 chip driver.
It's very similar to a patch I submitted for the lm80 a few days ago.


 drivers/i2c/chips/asb100.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
--- a/drivers/i2c/chips/asb100.c	Wed Apr 14 15:12:13 2004
+++ b/drivers/i2c/chips/asb100.c	Wed Apr 14 15:12:13 2004
@@ -124,7 +124,7 @@
 static u8 IN_TO_REG(unsigned val)
 {
 	unsigned nval = SENSORS_LIMIT(val, ASB100_IN_MIN, ASB100_IN_MAX);
-	return nval / 16;
+	return (nval + 8) / 16;
 }
 
 static unsigned IN_FROM_REG(u8 reg)




More information about the lm-sensors mailing list