Re: [PATCH] PCI and I2C fixes for 2.6.8

Greg KH
2004-08-24T00:12:25Z

ChangeSet 1.1807.56.38, 2004/08/09 13:42:54-07:00, khali@linux-fr.org

[PATCH] I2C: fix for previous lm83 driver update

Signed-off-by: Jean Delvare <khali at linux-fr dot org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>

drivers/i2c/chips/lm83.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff -Nru a/drivers/i2c/chips/lm83.c b/drivers/i2c/chips/lm83.c
--- a/drivers/i2c/chips/lm83.c 2004-08-23 11:03:01 -07:00
+++ b/drivers/i2c/chips/lm83.c 2004-08-23 11:03:01 -07:00
@@ -83,10 +83,10 @@
* The LM83 uses signed 8-bit values.
*/

-#define TEMP_FROM_REG(val) (((val) > 127 ? (val)-0xFF : (val)) * 1000)
-#define TEMP_TO_REG(val) ((val) <= -50000 ? -50 + 0xFF : (val) >= 127000 ? 127 : \
+#define TEMP_FROM_REG(val) (((val) > 127 ? (val) - 0x100 : (val)) * 1000)
+#define TEMP_TO_REG(val) ((val) <= -50000 ? -50 + 0x100 : (val) >= 127000 ? 127 : \
(val) > -500 ? ((val)+500) / 1000 : \
- ((val)-500) / 1000 + 0xFF)
+ ((val)-500) / 1000 + 0x100)

static const u8 LM83_REG_R_TEMP[] = {
LM83_REG_R_LOCAL_TEMP,