diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-04-26 16:34:26 +0200 |
---|---|---|
committer | Mark M. Hoffman <mhoffman@lightlink.com> | 2008-06-08 09:19:13 -0400 |
commit | 1dd64d541aef4107a44afe056b7a23167167806c (patch) | |
tree | a8d4827a0da8e1fa4515c61022fc57e26823c433 /drivers/hwmon | |
parent | 1bebd69bd392d3eebf6b461c19d9bf527082c850 (diff) |
hwmon: (adt7473) Initialize max_duty_at_overheat before use
data->max_duty_at_overheat is not updated in adt7473_update_device,
so it might be used before it is initialized (if the user reads from
sysfs file max_duty_at_crit before writing to it.)
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/adt7473.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c index c1009d6f9796..93dbf5e7ff8a 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c @@ -309,6 +309,9 @@ no_sensor_update: ADT7473_REG_PWM_BHVR(i)); } + i = i2c_smbus_read_byte_data(client, ADT7473_REG_CFG4); + data->max_duty_at_overheat = !!(i & ADT7473_CFG4_MAX_DUTY_AT_OVT); + data->limits_last_updated = local_jiffies; data->limits_valid = 1; |