Re: [PATCH] i2c driver fixes for 2.6.0-test5

From: Greg KH
Date: Mon Sep 22 2003 - 19:29:34 EST


ChangeSet 1.1153.123.2, 2003/09/04 11:28:46-07:00, azarah@xxxxxxxxxx

[PATCH] I2C: Fix conversion from milli volts in store_in_reg() for w83781d.c

I am not sure if it was a later patch from me that fixed in_* to display
milli volts in sysfs, or if it was a patch from Jan Dittmer, but the
conversion in the store_in_*() functions is wrong, and cause something
like:


drivers/i2c/chips/w83781d.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
--- a/drivers/i2c/chips/w83781d.c Mon Sep 22 16:16:19 2003
+++ b/drivers/i2c/chips/w83781d.c Mon Sep 22 16:16:19 2003
@@ -378,8 +378,8 @@
struct w83781d_data *data = i2c_get_clientdata(client); \
u32 val; \
\
- val = simple_strtoul(buf, NULL, 10); \
- data->in_##reg[nr] = (IN_TO_REG(val) / 10); \
+ val = simple_strtoul(buf, NULL, 10) / 10; \
+ data->in_##reg[nr] = IN_TO_REG(val); \
w83781d_write_value(client, W83781D_REG_IN_##REG(nr), data->in_##reg[nr]); \
\
return count; \

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/