From: Andreas Kemnade <andreas@kemnade.info>
To: lgirdwood@gmail.com, broonie@kernel.org, linux-kernel@vger.kernel.org
Cc: Andreas Kemnade <andreas@kemnade.info>
Subject: [PATCH] regulator: core: avoid error messages for deferred probing
Date: Mon, 25 Jan 2021 20:27:36 +0100 [thread overview]
Message-ID: <20210125192736.17657-1-andreas@kemnade.info> (raw)
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
next reply other threads:[~2021-01-25 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-25 19:27 Andreas Kemnade [this message]
2021-01-27 17:32 ` [PATCH] regulator: core: avoid error messages for deferred probing Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210125192736.17657-1-andreas@kemnade.info \
--to=andreas@kemnade.info \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).