From: Marcus Folkesson Date: Fri, 10 Mar 2023 07:50:35 +0000 (+0100) Subject: hwmon: (ina3221) return prober error code X-Git-Tag: baikal/mips/sdk6.1~107 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=7f377870c6a77d3e9a2b861b92185bcd9f3f60af;p=kernel.git hwmon: (ina3221) return prober error code [ Upstream commit 34e6a7f5748ee2704dde23a2c5309ac5755815dd ] ret is set to 0 which do not indicate an error. Return -EINVAL instead. Fixes: 332c1e488b8f ("hwmon: (ina3221) Read channel input source info from DT") Signed-off-by: Marcus Folkesson Link: https://lore.kernel.org/r/20230310075035.246083-1-marcus.folkesson@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c index e06186986444e..f3a4c5633b1ea 100644 --- a/drivers/hwmon/ina3221.c +++ b/drivers/hwmon/ina3221.c @@ -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];