hwmon: (lm85) Do not update hysteresis
PATCH v3 3/4 hwmon: (lm85) Do not update hysteresis
So far, the driver updates temp_auto_hyst and temp_auto_off if temp_auto_min changes. This may cause problems if temp_auto_off was not configured before configuring temp_auto_min, because one of the variables used (off_desired) is not initialized in this case.
To simplify the code, and for consistency with other drivers, no longer update the delta between "min" and "off" until the user sets the "off" value again.
--- drivers/hwmon/lm85.c | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-)
drivers/hwmon/lm85.c +0 -12
@@ -936,18 +936,6 @@ static ssize_t set_temp_auto_temp_min(struct device *dev, ((data->zone[nr].range &0x0f ) <<4 ) | (data->pwm_freq[nr] & 0x07)); -/* Update temp_auto_hyst and temp_auto_off */ - data->zone[nr].hyst =HYST_TO_REG (TEMP_FROM_REG ( - data->zone[nr].limit) -TEMP_FROM_REG ( - data->zone[nr].off_desired)); -if (nr =0 || nr =1 ) { -lm85_write_value (client,LM85_REG_AFAN_HYST1 , - (data->zone[0 ].hyst <<4 ) - | data->zone[1 ].hyst); - }else { -lm85_write_value (client,LM85_REG_AFAN_HYST2 , - (data->zone[2 ].hyst <<4 )); - }mutex_unlock (&data->update_lock);return count; }
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH v3 3/4] hwmon: (lm85) Do not update
Hi Guenter,
Quoted 26 lines · Guenter Roeck
So far, the driver updates
temp_auto_hystandtemp_auto_offiftemp_auto_minchanges. This may cause problems iftemp_auto_offwas not configured before configuringtemp_auto_min, because one of the variables used (off_desired) is not initialized in this case.To simplify the code, and for consistency with other drivers, no longer update the delta between "min" and "off" until the user sets the "off" value again.
Signed-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/lm85.c | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-)drivers/hwmon/lm85.c +0
-5@@ -936,18 +936,6 @@ static ssize_t set_temp_auto_temp_min(struct device *dev, ((data->zone[nr].range &0x0f ) <<4 ) | (data->pwm_freq[nr] & 0x07)); -/* Update temp_auto_hyst and temp_auto_off */ - data->zone[nr].hyst =HYST_TO_REG (TEMP_FROM_REG ( - data->zone[nr].limit) -TEMP_FROM_REG ( - data->zone[nr].off_desired)); -if (nr =0 || nr =1 ) {
drivers/hwmon/lm85.c static ssize_t set_temp_auto_temp_min(struct device *dev, · line 941
Quoted 10 lines
drivers/hwmon/lm85.c +0
-7-lm85_write_value (client,LM85_REG_AFAN_HYST1 , - (data->zone[0 ].hyst <<4 ) - | data->zone[1 ].hyst); - }else { -lm85_write_value (client,LM85_REG_AFAN_HYST2 , - (data->zone[2 ].hyst <<4 )); - }mutex_unlock (&data->update_lock);return count; }
Your patch is incomplete: you can now get rid of lm85_zone.off_desired altogether.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors