]> git.hungrycats.org Git - linux/commitdiff
[PATCH] I2C: Fix conversion from milli volts in store_in_reg() for w83781d.c
authorMartin Schlemmer <azarah@gentoo.org>
Thu, 4 Sep 2003 04:28:46 +0000 (21:28 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Thu, 4 Sep 2003 04:28:46 +0000 (21:28 -0700)
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

index 056ac7b0aef43b4767428ba130c96f4016260708..c6db6126af38237ad8d065668aab5f608d454e4b 100644 (file)
@@ -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; \