7506ebcd662b hwmon: (max6639) Fix range of pulses-per-revolution
Guenter Roeck
maintainerPATCH 1/1 7506ebcd662b hwmon: (max6639) Fix range of pulses-per-revolution
The valid range for the pulses-per-revolution devicetree property is 1..4. The current code checks for a range of 1..5. Fix it.
Fixes 7506ebcd662b ("hwmon: (max6639) : Configure based on DT property")
Cc Naresh Solanki <[email protected]>
Signed-off-by Guenter Roeck <[email protected]>
--- drivers/hwmon/max6639.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max6639.c +1 -1
@@ -540,7 +540,7 @@ static int max6639_probe_child_from_dt(struct i2c_client *client, err =of_property_read_u32 (child,"pulses-per-revolution" , &val);if (!err) { -if (val <1 || val >5 ) { +if (val <1 || val >4 ) {dev_err (dev,"invalid pulses-per-revolution %d of %pOFn\n" , val, child);return -EINVAL ; }
Signature · 1 line
2.45.2