Skip to contentSkip to conversation

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

PATCH New Guenter Roeck 1 participant 1 message Jul 2, 2014

Subsystems (2)
lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (adm1029) Update fan_div cache when writing fan divisor attribute

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.

---
 drivers/hwmon/adm1029.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/adm1029.c +1 -0
index 78339e8..45b2523 100644
@@ -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;
Signature · 7 lines
1.9.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors