hwmon: (it87) Fix pwm frequency display
Subsystems (2)
Guenter Roeck
maintainerPATCH 1/1 hwmon: (it87) Fix pwm frequency display
Commit 687c68dd7955 ("hwmon: (it87) Fix PWM frequency display for chips with newer PWM control") tried to fix pwm frequency display but got operator precedence all wrong, resulting in a pwm frequency display of 256 or, with older chips, a division by zero.
Signed-off-by Guenter Roeck <[email protected]>
---
I might actually fold this one into the original patch, given the severeness of the problem.
drivers/hwmon/it87.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/it87.c +1 -1
@@ -1085,7 +1085,7 @@ static ssize_t show_pwm_freq(struct device *dev, struct device_attribute *attr,else index = (data->fan_ctl >>4 ) &0x07 ; - freq = pwm_freq[index] /has_newer_autopwm (data) ?256 :128 ; + freq = pwm_freq[index] / (has_newer_autopwm (data) ?256 :128 );return sprintf (buf,"%u\n" , freq); }
Signature · 7 lines
2.1.0 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors