[PATCH] regulator: core: move warning message below EPROBE_DEFER

Christian Eggers posted 1 patch 11 months ago
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] regulator: core: move warning message below EPROBE_DEFER
Posted by Christian Eggers 11 months ago
Avoid getting extra "supply XXX not found, using dummy regulator"
messages at startup (in case that the dummy regulator has not fully been
probed at this time).

Suggested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Christian Eggers <ceggers@arri.de>
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 4276493ce7c6..4d0f13899e6b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2219,10 +2219,10 @@ struct regulator *_regulator_get_common(struct regulator_dev *rdev, struct devic
 			 * enabled, even if it isn't hooked up, and just
 			 * provide a dummy.
 			 */
-			dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
 			rdev = dummy_regulator_rdev;
 			if (!rdev)
 				return ERR_PTR(-EPROBE_DEFER);
+			dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
 			get_device(&rdev->dev);
 			break;
 
-- 
2.44.1
Re: [PATCH] regulator: core: move warning message below EPROBE_DEFER
Posted by Mark Brown 11 months ago
On Thu, Mar 13, 2025 at 03:36:21PM +0100, Christian Eggers wrote:
> Avoid getting extra "supply XXX not found, using dummy regulator"
> messages at startup (in case that the dummy regulator has not fully been
> probed at this time).

Thanks, I had actually unwound the commit and have your new version in
CI now since it was tip of tree and I wanted to get this into -next.