Commit 395a41a1 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Mark Brown

regulator: Return actual error in of_regulator_bulk_get_all()

If regulator_get() in of_regulator_bulk_get_all() returns an error, that
error gets overridden and -EINVAL is always passed out. This masks probe
deferral requests and likely won't work properly in all cases.

Fix this by letting of_regulator_bulk_get_all() return the original
error code.

Fixes: 27b9ecc7 ("regulator: Add of_regulator_bulk_get_all")
Signed-off-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Link: https://patch.msgid.link/20240822072047.3097740-3-wenst@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ad9d7a82
......@@ -777,7 +777,7 @@ int of_regulator_bulk_get_all(struct device *dev, struct device_node *np,
name[i] = '\0';
tmp = regulator_get(dev, name);
if (IS_ERR(tmp)) {
ret = -EINVAL;
ret = PTR_ERR(tmp);
goto error;
}
(*consumers)[n].consumer = tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment