summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Folkesson <marcus.folkesson@gmail.com>2023-03-10 10:50:35 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-22 15:28:07 +0300
commit9eb394919c972245d0733e81875cec85339ca19c (patch)
tree785e4e7ed05d0d30eadd5f4b1c359d4eaf558906
parent26c176ce902861a45f8d699e057245ed7e0bcdf2 (diff)
downloadlinux-9eb394919c972245d0733e81875cec85339ca19c.tar.xz
hwmon: (ina3221) return prober error code
[ Upstream commit c93f5e2ab53243b17febabb9422a697017d3d49a ] ret is set to 0 which do not indicate an error. Return -EINVAL instead. Fixes: a9e9dd9c6de5 ("hwmon: (ina3221) Read channel input source info from DT") Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Link: https://lore.kernel.org/r/20230310075035.246083-1-marcus.folkesson@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/hwmon/ina3221.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/ina3221.c b/drivers/hwmon/ina3221.c
index 026f70d7c5a4..1b7f92f23530 100644
--- a/drivers/hwmon/ina3221.c
+++ b/drivers/hwmon/ina3221.c
@@ -672,7 +672,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];