hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/hwmon/gsc-hwmon.c
....@@ -82,8 +82,8 @@
8282 if (kstrtol(buf, 10, &temp))
8383 return -EINVAL;
8484
85
- temp = clamp_val(temp, 0, 10000);
86
- temp = DIV_ROUND_CLOSEST(temp, 10);
85
+ temp = clamp_val(temp, 0, 100000);
86
+ temp = DIV_ROUND_CLOSEST(temp, 100);
8787
8888 regs[0] = temp & 0xff;
8989 regs[1] = (temp >> 8) & 0xff;
....@@ -100,7 +100,7 @@
100100 {
101101 struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
102102
103
- return sprintf(buf, "%d\n", 255 * (50 + (attr->index * 10)) / 100);
103
+ return sprintf(buf, "%d\n", 255 * (50 + (attr->index * 10)));
104104 }
105105
106106 static SENSOR_DEVICE_ATTR_RO(pwm1_auto_point1_pwm, pwm_auto_point_pwm, 0);