[PATCH 2/3] test: phy: test generic_setup(shutdown)_phy_bulk()

Yang Xiwen via B4 Relay devnull+forbidden405.outlook.com at kernel.org
Thu Feb 1 14:16:09 CET 2024


From: Yang Xiwen <forbidden405 at outlook.com>

add unittests for the newly introduced helper functions.

Signed-off-by: Yang Xiwen <forbidden405 at outlook.com>
---
 test/dm/phy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/dm/phy.c b/test/dm/phy.c
index 0cf3689fde..cb16844a0a 100644
--- a/test/dm/phy.c
+++ b/test/dm/phy.c
@@ -159,6 +159,8 @@ static int dm_test_phy_bulk(struct unit_test_state *uts)
 	ut_asserteq(0, generic_phy_power_on_bulk(&phys));
 	ut_asserteq(0, generic_phy_power_off_bulk(&phys));
 	ut_asserteq(0, generic_phy_exit_bulk(&phys));
+	ut_asserteq(0, generic_setup_phy_bulk(parent, &phys));
+	ut_asserteq(0, generic_shutdown_phy_bulk(&phys));
 
 	/* has a known problem phy */
 	ut_assertok(uclass_get_device_by_name(UCLASS_SIMPLE_BUS,
@@ -171,6 +173,8 @@ static int dm_test_phy_bulk(struct unit_test_state *uts)
 	ut_asserteq(-EIO, generic_phy_power_on_bulk(&phys));
 	ut_asserteq(-EIO, generic_phy_power_off_bulk(&phys));
 	ut_asserteq(0, generic_phy_exit_bulk(&phys));
+	ut_asserteq(-EIO, generic_setup_phy_bulk(parent, &phys));
+	ut_asserteq(-EIO, generic_shutdown_phy_bulk(&phys));
 
 	return 0;
 }

-- 
2.43.0



More information about the U-Boot mailing list