]> git.baikalelectronics.ru Git - kernel.git/commitdiff
hwmon: (ina3221) return prober error code
authorMarcus Folkesson <marcus.folkesson@gmail.com>
Fri, 10 Mar 2023 07:50:35 +0000 (08:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:28:07 +0000 (13:28 +0100)
[ Upstream commit c93f5e2ab53243b17febabb9422a697017d3d49a ]

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 <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>
drivers/hwmon/ina3221.c

index 026f70d7c5a43b8f822e4c69b85c26990932da41..1b7f92f23530cf456c2f99647601cbef69fa83d0 100644 (file)
@@ -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];