mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: core: avoid error messages for deferred probing
@ 2021-01-25 19:27 Andreas Kemnade
  2021-01-27 17:32 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Kemnade @ 2021-01-25 19:27 UTC (permalink / raw)
  To: lgirdwood, broonie, linux-kernel; +Cc: Andreas Kemnade

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@kemnade.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-27 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 19:27 [PATCH] regulator: core: avoid error messages for deferred probing Andreas Kemnade
2021-01-27 17:32 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®