Commit dcffa9b8 authored by Martin Schlemmer's avatar Martin Schlemmer Committed by Greg Kroah-Hartman

[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:
parent 0e4e2505
No related merge requests found
......@@ -378,8 +378,8 @@ static ssize_t store_in_##reg (struct device *dev, const char *buf, size_t count
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; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment