All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] hwmon: (adm1029) Update fan_div cache when writing fan divisor attribute
@ 2014-07-02  0:18 Guenter Roeck
  0 siblings, 0 replies; only message in thread
From: Guenter Roeck @ 2014-07-02  0:18 UTC (permalink / raw)
  To: lm-sensors

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@roeck-us.net>
---
 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@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-02  0:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02  0:18 [lm-sensors] [PATCH] hwmon: (adm1029) Update fan_div cache when writing fan divisor attribute Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.