mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH] fixup! test: self: add basic regulator selftest
Date: Tue,  2 May 2023 12:02:16 +0200	[thread overview]
Message-ID: <20230502100216.334096-1-ahmad@a3f.at> (raw)
In-Reply-To: <20230424115908.115474-2-ahmad@a3f.at>

  - fix order, so test doesn't fail.
  - print debug message before registration, so early failure
    is easier to follow
  - don't define DEBUG by default

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 test/self/regulator.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/test/self/regulator.c b/test/self/regulator.c
index adb4d93c2114..1ccaae0ed332 100644
--- a/test/self/regulator.c
+++ b/test/self/regulator.c
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#define DEBUG 1
+
 #include <common.h>
 #include <bselftest.h>
 #include <driver.h>
@@ -60,12 +60,8 @@ static const struct regulator_ops test_regulator_ops_range = {
 };
 
 enum {
-	/*
-	 * This is intentionally ordered that way to test registering
-	 * an always-on regulator before its sibling that it depends on
-	 */
-	TEST_LDO1,
 	TEST_BUCK,
+	TEST_LDO1,
 	TEST_LDO2,
 	TEST_REGULATORS_NUM
 };
@@ -106,13 +102,12 @@ static int test_regulator_register(struct test_regulator *priv, int id,
 	cfg->rdev.desc = &cfg->desc;
 	cfg->rdev.dev = dev;
 
+	dev_dbg(dev, "registering %s\n", match->name);
+
 	ret = of_regulator_register(&cfg->rdev, match->of_node);
 	if (ret)
 		return dev_err_probe(dev, ret, "failed to register %s regulator\n",
 				     match->name);
-
-	dev_dbg(dev, "registered %s\n", match->name);
-
 	return 0;
 }
 
-- 
2.38.4




      parent reply	other threads:[~2023-05-02 10:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-24 11:59 [PATCH 1/2] regulator: core: add debug print for regulator_resolve_supply Ahmad Fatoum
2023-04-24 11:59 ` [PATCH 2/2] test: self: add basic regulator selftest Ahmad Fatoum
2023-05-02  9:22   ` Sascha Hauer
2023-05-02 10:04     ` Ahmad Fatoum
2023-05-02 11:22       ` Sascha Hauer
2023-05-02 10:02   ` Ahmad Fatoum [this message]

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=20230502100216.334096-1-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.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