[PATCH] hwmon: (adm1029) Update fan_div cache when writing fan divisor attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When writing a new value into the fan1_div or fan2_div attribute,
the written value was not copied into the cache. This could result
in reading an old attribute value for up to two seconds after updating
the fan divisor, since values are cached for that long by the driver.

Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
 drivers/hwmon/adm1029.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwmon/adm1029.c b/drivers/hwmon/adm1029.c
index 78339e8..45b2523 100644
--- a/drivers/hwmon/adm1029.c
+++ b/drivers/hwmon/adm1029.c
@@ -235,6 +235,7 @@ static ssize_t set_fan_div(struct device *dev,
 	/* Write value */
 	i2c_smbus_write_byte_data(client,
 				  ADM1029_REG_FAN_DIV[attr->index], reg);
+	data->fan_div[attr->index] = reg;
 	mutex_unlock(&data->update_lock);
 
 	return count;
-- 
1.9.1


_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux