Commit c93f5e2a authored by Marcus Folkesson's avatar Marcus Folkesson Committed by Guenter Roeck
Browse files

hwmon: (ina3221) return prober error code



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

Fixes: a9e9dd9c ("hwmon: (ina3221) Read channel input source info from DT")
Signed-off-by: default avatarMarcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20230310075035.246083-1-marcus.folkesson@gmail.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent cb090e64
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -772,7 +772,7 @@ static int ina3221_probe_child_from_dt(struct device *dev,
		return ret;
		return ret;
	} else if (val > INA3221_CHANNEL3) {
	} else if (val > INA3221_CHANNEL3) {
		dev_err(dev, "invalid reg %d of %pOFn\n", val, child);
		dev_err(dev, "invalid reg %d of %pOFn\n", val, child);
		return ret;
		return -EINVAL;
	}
	}


	input = &ina->inputs[val];
	input = &ina->inputs[val];