[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210125192736.17657-1-andreas@kemnade.info>
Date: Mon, 25 Jan 2021 20:27:36 +0100
From: Andreas Kemnade <andreas@...nade.info>
To: lgirdwood@...il.com, broonie@...nel.org,
linux-kernel@...r.kernel.org
Cc: Andreas Kemnade <andreas@...nade.info>
Subject: [PATCH] regulator: core: avoid error messages for deferred probing
Noise like this happens on boot with regulators which can be bypassed
when the supply is not probed. That looks too alarming and confusing.
[ 3.844092] vddpu: bypassed regulator has no supply!
[ 3.849105] vddpu: failed to get the current voltage: -EPROBE_DEFER
[ 3.855591] vddpu: supplied by DCDC1
[ 3.877211] vddsoc: bypassed regulator has no supply!
[ 3.882538] vddsoc: failed to get the current voltage: -EPROBE_DEFER
[ 3.888975] vddsoc: supplied by DCDC1
Handle such issues silently.
Signed-off-by: Andreas Kemnade <andreas@...nade.info>
---
drivers/regulator/core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index ca03d8e70bd1..238745fc97c2 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1168,6 +1168,9 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
current_uV = regulator_get_voltage_rdev(rdev);
}
+ if (current_uV == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+
if (current_uV < 0) {
rdev_err(rdev,
"failed to get the current voltage: %pe\n",
@@ -4151,9 +4154,12 @@ int regulator_get_voltage_rdev(struct regulator_dev *rdev)
if (bypassed) {
/* if bypassed the regulator must have a supply */
if (!rdev->supply) {
+ if (rdev->supply_name)
+ return -EPROBE_DEFER;
+
rdev_err(rdev,
"bypassed regulator has no supply!\n");
- return -EPROBE_DEFER;
+ return -EINVAL;
}
return regulator_get_voltage_rdev(rdev->supply->rdev);
--
2.29.2
Powered by blists - more mailing lists