Skip to content

Commit

Permalink
hwmon: (ina3221) return prober error code
Browse files Browse the repository at this point in the history
ret is set to 0 which do not indicate an error.
Return -EINVAL instead.

Fixes: a9e9dd9 ("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>
  • Loading branch information
marcusfolkesson authored and groeck committed Mar 12, 2023
1 parent cb090e6 commit c93f5e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/ina3221.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit c93f5e2

Please sign in to comment.