From: Chen-Yu Tsai Date: Thu, 22 Aug 2024 07:20:45 +0000 (+0800) Subject: regulator: Return actual error in of_regulator_bulk_get_all() X-Git-Tag: v6.12-rc1~190^2~26^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=395a41a1d3e377462f3eea8a205ee72be8885ff6;p=thirdparty%2Fkernel%2Flinux.git 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: 27b9ecc7a9ba ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Chen-Yu Tsai Link: https://patch.msgid.link/20240822072047.3097740-3-wenst@chromium.org Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c index 03afc160fc72c..86b680adbf01c 100644 --- a/drivers/regulator/of_regulator.c +++ b/drivers/regulator/of_regulator.c @@ -777,7 +777,7 @@ restart: name[i] = '\0'; tmp = regulator_get(dev, name); if (IS_ERR(tmp)) { - ret = -EINVAL; + ret = PTR_ERR(tmp); goto error; } (*consumers)[n].consumer = tmp;