[U-Boot] [PATCH v2 10/11] sandbox: tests: Exclude common test code (pmic_get) in test/dm/pmic.c
Lukasz Majewski
lukma at denx.de
Sun May 6 20:26:07 UTC 2018
The common code can be excluded to be reused by tests for other PMIC.
Signed-off-by: Lukasz Majewski <lukma at denx.de>
---
Changes in v2:
- New patch
test/dm/pmic.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/test/dm/pmic.c b/test/dm/pmic.c
index 0e5d671924..83994f5f9f 100644
--- a/test/dm/pmic.c
+++ b/test/dm/pmic.c
@@ -22,9 +22,9 @@
#include <test/ut.h>
/* Test PMIC get method */
-static int dm_test_power_pmic_get(struct unit_test_state *uts)
+
+static inline int power_pmic_get(struct unit_test_state *uts, char *name)
{
- const char *name = "sandbox_pmic";
struct udevice *dev;
ut_assertok(pmic_get(name, &dev));
@@ -35,6 +35,14 @@ static int dm_test_power_pmic_get(struct unit_test_state *uts)
return 0;
}
+
+/* Test PMIC get method */
+static int dm_test_power_pmic_get(struct unit_test_state *uts)
+{
+ power_pmic_get(uts, "sandbox_pmic");
+
+ return 0;
+}
DM_TEST(dm_test_power_pmic_get, DM_TESTF_SCAN_FDT);
/* Test PMIC I/O */
--
2.11.0
More information about the U-Boot
mailing list