Skip to contentSkip to conversation

hwmon: (ina3221) return prober error code

PATCH Applied Marcus Folkesson 2 participants 2 messages Mar 10, 2023 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (ina3221) return prober error code

ret is set to 0 which do not indicate an error.
Return -EINVAL instead.

---
 drivers/hwmon/ina3221.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/ina3221.c +1 -1
index e06186986444..f3a4c5633b1e 100644
@@ -772,7 +772,7 @@ static int ina3221_probe_child_from_dt(struct device *dev,
 		return ret;
 	} else if (val > INA3221_CHANNEL3) {
 		dev_err(dev, "invalid reg %d of %pOFn\n", val, child);
-		return ret;
+		return -EINVAL;
 	}
 
 	input = &ina->inputs[val];
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 4 lines · Marcus Folkesson

ret is set to 0 which do not indicate an error.
Return -EINVAL instead.

Applied.

Thanks,
Guenter

Quoted 17 lines
---
 drivers/hwmon/ina3221.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/ina3221.c +1 -1
index e06186986444..f3a4c5633b1e 100644
@@ -772,7 +772,7 @@ static int ina3221_probe_child_from_dt(struct device *dev,
 		return ret;
 	} else if (val > INA3221_CHANNEL3) {
 		dev_err(dev, "invalid reg %d of %pOFn\n", val, child);
-		return ret;
+		return -EINVAL;
 	}
 
 	input = &ina->inputs[val];