summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRobert Coulson <rob.coulson@gmail.com>2014-08-28 10:45:43 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-05 14:52:19 -0700
commit41950abc621b8d66510d7983d2b26e31da7b2c8c (patch)
treead40d604575253877b6d541dce088daacafbbe42 /drivers
parente6fe40c1752c08b272d24cb918d90a257526ce8c (diff)
downloadlwn-41950abc621b8d66510d7983d2b26e31da7b2c8c.tar.gz
lwn-41950abc621b8d66510d7983d2b26e31da7b2c8c.zip
hwmon: (ds1621) Update zbits after conversion rate change
commit 39c627a084475e8a690a4a9e7601410ca173ddd2 upstream. After the conversion rate is changed, the zbits are not updated, but should be, since they are used later in the set_temp function. Fixes: a50d9a4d9ad3 ("hwmon: (ds1621) Fix temperature rounding operations") Reported-by: Murat Ilsever <murat.ilsever@gmail.com> Signed-off-by: Robert Coulson <rob.coulson@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/ds1621.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index fc6f5d54e7f7..8890870309e4 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -309,6 +309,7 @@ static ssize_t set_convrate(struct device *dev, struct device_attribute *da,
data->conf |= (resol << DS1621_REG_CONFIG_RESOL_SHIFT);
i2c_smbus_write_byte_data(client, DS1621_REG_CONF, data->conf);
data->update_interval = ds1721_convrates[resol];
+ data->zbits = 7 - resol;
mutex_unlock(&data->update_lock);
return count;