.. | .. |
---|
82 | 82 | if (kstrtol(buf, 10, &temp)) |
---|
83 | 83 | return -EINVAL; |
---|
84 | 84 | |
---|
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); |
---|
87 | 87 | |
---|
88 | 88 | regs[0] = temp & 0xff; |
---|
89 | 89 | regs[1] = (temp >> 8) & 0xff; |
---|
.. | .. |
---|
100 | 100 | { |
---|
101 | 101 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
---|
102 | 102 | |
---|
103 | | - return sprintf(buf, "%d\n", 255 * (50 + (attr->index * 10)) / 100); |
---|
| 103 | + return sprintf(buf, "%d\n", 255 * (50 + (attr->index * 10))); |
---|
104 | 104 | } |
---|
105 | 105 | |
---|
106 | 106 | static SENSOR_DEVICE_ATTR_RO(pwm1_auto_point1_pwm, pwm_auto_point_pwm, 0); |
---|