Skip to contentSkip to conversation

7506ebcd662b hwmon: (max6639) Fix range of pulses-per-revolution

PATCH Superseded Guenter Roeck 1 participant 1 message Mar 20 Hardware monitoring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 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]>
---
 drivers/hwmon/max6639.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max6639.c +1 -1
index 9a3c515efe2e..1e0550e27626 100644
@@ -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