Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (ds1621) Update zbits after conversion rate change

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>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Robert Coulson and committed by
Guenter Roeck
39c627a0 52addcf9

+1
+1
drivers/hwmon/ds1621.c
··· 309 309 data->conf |= (resol << DS1621_REG_CONFIG_RESOL_SHIFT); 310 310 i2c_smbus_write_byte_data(client, DS1621_REG_CONF, data->conf); 311 311 data->update_interval = ds1721_convrates[resol]; 312 + data->zbits = 7 - resol; 312 313 mutex_unlock(&data->update_lock); 313 314 314 315 return count;