]> git.hungrycats.org Git - linux/commitdiff
[PATCH] I2C: Fix voltage rounding in asb100
authorJean Delvare <khali@linux-fr.org>
Wed, 14 Apr 2004 06:10:38 +0000 (23:10 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 14 Apr 2004 06:10:38 +0000 (23:10 -0700)
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

index 288fb9ea7374c0a70fe1bd28b0d1b45609c772ca..355972cff6d9df91ea5ec24ab681aea9a6e03077 100644 (file)
@@ -124,7 +124,7 @@ static const u16 asb100_reg_temp_hyst[]     = {0, 0x3a, 0x153, 0x253, 0x19};
 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)